Commit e7d8f798a0e6bf6277c67f3f4859d38a3317be01

Authored by Paulo Henrique Junqueira Amorim
1 parent 852d3415

ENH: Change function name of GetSpacing to GetZSpacing

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
invesalius/reader/dicom_grouper.py
@@ -65,7 +65,7 @@ class DicomGroup: @@ -65,7 +65,7 @@ class DicomGroup:
65 # IDEA (13/10): Represent internally as dictionary, 65 # IDEA (13/10): Represent internally as dictionary,
66 # externally as list 66 # externally as list
67 self.nslices = 0 67 self.nslices = 0
68 - self.spacing = 0 68 + self.zspacing = 0
69 69
70 def AddSlice(self, dicom): 70 def AddSlice(self, dicom):
71 pos = tuple(dicom.image.position) 71 pos = tuple(dicom.image.position)
@@ -92,7 +92,7 @@ class DicomGroup: @@ -92,7 +92,7 @@ class DicomGroup:
92 list_ = sorted(list_, key = lambda dicom:dicom.image.position[axis]) 92 list_ = sorted(list_, key = lambda dicom:dicom.image.position[axis])
93 return list_ 93 return list_
94 94
95 - def GetSpacing(self): 95 + def GetZSpacing(self):
96 list_ = self.GetSortedList() 96 list_ = self.GetSortedList()
97 97
98 if (len(list_) > 1): 98 if (len(list_) > 1):
@@ -104,9 +104,9 @@ class DicomGroup: @@ -104,9 +104,9 @@ class DicomGroup:
104 dicom = list_[1] 104 dicom = list_[1]
105 p2 = dicom.image.position[axis] 105 p2 = dicom.image.position[axis]
106 106
107 - self.spacing = abs(p1 - p2) 107 + self.zspacing = abs(p1 - p2)
108 else: 108 else:
109 - self.spacing = 1 109 + self.zspacing = 1
110 110
111 class PatientGroup: 111 class PatientGroup:
112 def __init__(self): 112 def __init__(self):
@@ -146,7 +146,7 @@ class PatientGroup: @@ -146,7 +146,7 @@ class PatientGroup:
146 self.AddFile(dicom, index+1) 146 self.AddFile(dicom, index+1)
147 147
148 #Getting the spacing in the Z axis 148 #Getting the spacing in the Z axis
149 - group.GetSpacing() 149 + group.GetZSpacing()
150 150
151 def Update(self): 151 def Update(self):
152 # Ideally, AddFile would be sufficient for splitting DICOM 152 # Ideally, AddFile would be sufficient for splitting DICOM
@@ -237,14 +237,14 @@ class PatientGroup: @@ -237,14 +237,14 @@ class PatientGroup:
237 group.AddSlice(current) 237 group.AddSlice(current)
238 dict_final[group_counter] = group 238 dict_final[group_counter] = group
239 #Getting the spacing in the Z axis 239 #Getting the spacing in the Z axis
240 - group.GetSpacing() 240 + group.GetZSpacing()
241 else: 241 else:
242 group_counter +=1 242 group_counter +=1
243 group = DicomGroup() 243 group = DicomGroup()
244 group.AddSlice(current) 244 group.AddSlice(current)
245 dict_final[group_counter] = group 245 dict_final[group_counter] = group
246 #Getting the spacing in the Z axis 246 #Getting the spacing in the Z axis
247 - group.GetSpacing() 247 + group.GetZSpacing()
248 248
249 249
250 return dict_final 250 return dict_final