Commit fe5a5962bb8077cd019d4cf9869e05ba3a834ae9

Authored by tatiana
1 parent 38def2d6

ENH: #47 Spacing info inside import panel

.gitignore
  1 +invesalius/*.classpath
  2 +invesalius/*.hg
1 3 invesalius/*.log
  4 +invesalius/*.project
2 5 invesalius/*.pyc
  6 +invesalius/*.swn
  7 +invesalius/*.swo
  8 +invesalius/*.swp
3 9 invesalius/data/*.log
4 10 invesalius/data/*.pyc
5 11 invesalius/gui/*.log
... ...
invesalius/constants.py
... ... @@ -239,7 +239,7 @@ ID_TO_BMP = {VOL_FRONT: ["Front", os.path.join(ICON_DIR, "view_front.png")],
239 239 }
240 240  
241 241 # if 1, use vtkVolumeRaycastMapper, if 0, use vtkFixedPointVolumeRayCastMapper
242   -TYPE_RAYCASTING_MAPPER = 0
  242 +TYPE_RAYCASTING_MAPPER = 1
243 243  
244 244 folder=RAYCASTING_PRESETS_DIRECTORY= os.path.abspath(os.path.join("..",
245 245 "presets",
... ... @@ -296,7 +296,7 @@ FILETYPE_VRML = wx.NewId()
296 296 FILETYPE_OBJ = wx.NewId()
297 297 FILETYPE_VTP = wx.NewId()
298 298 FILETYPE_PLY = wx.NewId()
299   -
  299 +
300 300 FILETYPE_IMAGEDATA = wx.NewId()
301 301  
302 302 FILETYPE_BMP = wx.NewId()
... ...
invesalius/control.py
... ... @@ -265,7 +265,7 @@ class Controller():
265 265  
266 266 if len(patients_groups):
267 267 group = dcm.SelectLargerDicomGroup(patients_groups)
268   - imagedata, dicom = self.OpenDicomGroup(group, gui=False)
  268 + imagedata, dicom = self.OpenDicomGroup(group, gui=True)
269 269 self.CreateDicomProject(imagedata, dicom)
270 270 # OPTION 2: ANALYZE?
271 271 else:
... ...
invesalius/data/imagedata_utils.py
... ... @@ -55,22 +55,31 @@ def ResampleImage2D(imagedata, xy_dimension,
55 55 Resample vtkImageData matrix.
56 56 """
57 57 extent = imagedata.GetExtent()
  58 + print "-----------------------------"
  59 + print "extent:", extent
58 60 spacing = imagedata.GetSpacing()
  61 + print "spacing:", spacing
59 62  
60   - if extent[1]==extent[3]:
61   - f = extent[1]
62   - x = 0
63   - y = 1
  63 + #if extent[1]==extent[3]:
  64 + # f = extent[1]
  65 + #elif extent[1]==extent[5]:
  66 + # f = extent[1]
  67 + #elif extent[3]==extent[5]:
  68 + # f = extent[3]
64 69  
65   - elif extent[1]==extent[5]:
  70 + if abs(extent[1]-extent[3]) < abs(extent[3]-extent[5]):
  71 + print 1
66 72 f = extent[1]
67   - x=0
68   - y=2
69   -
70   - elif extent[3]==extent[5]:
  73 + elif abs(extent[1]-extent[5]) < abs(extent[1] - extent[3]):
  74 + print 2
  75 + f = extent[1]
  76 + elif abs(extent[3]-extent[5]) < abs(extent[1] - extent[3]):
  77 + print 3
71 78 f = extent[3]
72   - x = 1
73   - y = 2
  79 + else:
  80 + print 4
  81 + f = extent[1]
  82 +
74 83  
75 84 factor = xy_dimension/float(f+1)
76 85  
... ...
invesalius/gui/dialogs.py
... ... @@ -41,7 +41,9 @@ class NumberDialog(wx.Dialog):
41 41  
42 42 # Numeric value to be changed by user
43 43 num_ctrl = masked.NumCtrl(self, value=value, integerWidth=3,
44   - fractionWidth=2, allowNegative=True)
  44 + fractionWidth=2,
  45 + allowNegative=True,
  46 + signedForegroundColour = "Black")
45 47 self.num_ctrl = num_ctrl
46 48  
47 49 # Buttons
... ...
invesalius/gui/dicom_preview_panel.py
... ... @@ -40,6 +40,7 @@ MAX_VALUE = NCOLS*NROWS
40 40  
41 41  
42 42 STR_SIZE = "Image size: %d x %d"
  43 +STR_SPC = "Spacing: %.2f"
43 44 STR_LOCAL = "Location: %.2f"
44 45 STR_PATIENT = "%s\n%s"
45 46 STR_ACQ = "%s %s\nMade in InVesalius"
... ... @@ -194,7 +195,9 @@ class SingleImagePreview(wx.Panel):
194 195 self.text_image_size.SetValue(value)
195 196  
196 197 ## Text related to slice position
197   - value = STR_LOCAL %(dicom.image.position[2])
  198 + value1 = STR_SPC %(dicom.image.spacing[2])
  199 + value2 = STR_LOCAL %(dicom.image.position[2])
  200 + value = "%s\n%s" %(value1, value2)
198 201 self.text_image_location.SetValue(value)
199 202  
200 203 ## Text related to patient/ acquisiiton data
... ...
invesalius/session.py
... ... @@ -27,6 +27,7 @@ class Session(object):
27 27 os.makedirs(invdir)
28 28 self.invdir = invdir
29 29  
  30 + # ?
30 31 self.temp_item = False
31 32  
32 33 # Recent projects list
... ...