Commit 914780e9d02918e506cdc49368354934c5f0fdd2
1 parent
dc3c7ce0
Exists in
master
and in
3 other branches
Created default values to the projections
Showing
3 changed files
with
11 additions
and
5 deletions
Show diff stats
invesalius/constants.py
@@ -554,3 +554,7 @@ PROJECTION_MIDA=5 | @@ -554,3 +554,7 @@ PROJECTION_MIDA=5 | ||
554 | PROJECTION_CONTOUR_MIP=6 | 554 | PROJECTION_CONTOUR_MIP=6 |
555 | PROJECTION_CONTOUR_LMIP=7 | 555 | PROJECTION_CONTOUR_LMIP=7 |
556 | PROJECTION_CONTOUR_MIDA=8 | 556 | PROJECTION_CONTOUR_MIDA=8 |
557 | + | ||
558 | +#------------ Projections defaults ------------------ | ||
559 | +PROJECTION_BORDER_SIZE=1.0 | ||
560 | +PROJECTION_MIP_SIZE=2 |
invesalius/data/slice_.py
@@ -86,7 +86,7 @@ class Slice(object): | @@ -86,7 +86,7 @@ class Slice(object): | ||
86 | self._matrix = None | 86 | self._matrix = None |
87 | 87 | ||
88 | self._type_projection = const.PROJECTION_NORMAL | 88 | self._type_projection = const.PROJECTION_NORMAL |
89 | - self.n_border = 3.0 | 89 | + self.n_border = const.PROJECTION_BORDER_SIZE |
90 | 90 | ||
91 | self.spacing = (1.0, 1.0, 1.0) | 91 | self.spacing = (1.0, 1.0, 1.0) |
92 | 92 |
invesalius/data/viewer_slice.py
@@ -60,13 +60,15 @@ ORIENTATIONS = { | @@ -60,13 +60,15 @@ ORIENTATIONS = { | ||
60 | class ContourMIPConfig(wx.Panel): | 60 | class ContourMIPConfig(wx.Panel): |
61 | def __init__(self, prnt, orientation): | 61 | def __init__(self, prnt, orientation): |
62 | wx.Panel.__init__(self, prnt) | 62 | wx.Panel.__init__(self, prnt) |
63 | - self.mip_size_spin = wx.SpinCtrl(self, -1, min=1, max=240, initial=1) | 63 | + self.mip_size_spin = wx.SpinCtrl(self, -1, min=1, max=240, |
64 | + initial=const.PROJECTION_MIP_SIZE) | ||
64 | w, h = self.mip_size_spin.GetTextExtent('M') | 65 | w, h = self.mip_size_spin.GetTextExtent('M') |
65 | self.mip_size_spin.SetMinSize((4 * w + 10, -1)) | 66 | self.mip_size_spin.SetMinSize((4 * w + 10, -1)) |
66 | self.mip_size_spin.SetMaxSize((4 * w + 10, -1)) | 67 | self.mip_size_spin.SetMaxSize((4 * w + 10, -1)) |
67 | self.border_spin = FS.FloatSpin(self, -1, min_val=0, max_val=10, | 68 | self.border_spin = FS.FloatSpin(self, -1, min_val=0, max_val=10, |
68 | - increment=0.1, value=0.1, digits=1, | ||
69 | - agwStyle=FS.FS_LEFT) | 69 | + increment=0.1, |
70 | + value=const.PROJECTION_BORDER_SIZE, | ||
71 | + digits=1, agwStyle=FS.FS_LEFT) | ||
70 | w, h = self.border_spin.GetTextExtent('M') | 72 | w, h = self.border_spin.GetTextExtent('M') |
71 | self.border_spin.SetMinSize((5 * w + 10, -1)) | 73 | self.border_spin.SetMinSize((5 * w + 10, -1)) |
72 | self.border_spin.SetMaxSize((5 * w + 10, -1)) | 74 | self.border_spin.SetMaxSize((5 * w + 10, -1)) |
@@ -142,7 +144,7 @@ class Viewer(wx.Panel): | @@ -142,7 +144,7 @@ class Viewer(wx.Panel): | ||
142 | self.left_pressed = 0 | 144 | self.left_pressed = 0 |
143 | self.right_pressed = 0 | 145 | self.right_pressed = 0 |
144 | 146 | ||
145 | - self._number_slices = 10 | 147 | + self._number_slices = const.PROJECTION_MIP_SIZE |
146 | self._mip_inverted = False | 148 | self._mip_inverted = False |
147 | 149 | ||
148 | self.spined_image = False #Use to control to spin | 150 | self.spined_image = False #Use to control to spin |