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