Commit 994c846ff487d324ddb7f026c33358414a0bc288
1 parent
cf6af70c
Exists in
master
and in
68 other branches
ENH: Redesign previous implementation, (Crash open CORONAL slices)
Showing
2 changed files
with
8 additions
and
15 deletions
Show diff stats
invesalius/reader/dicom_grouper.py
| ... | ... | @@ -121,7 +121,6 @@ class ivDicomGroups: |
| 121 | 121 | spacing = parser.GetPixelSpacing() |
| 122 | 122 | id_study = parser.GetStudyID() |
| 123 | 123 | tilt = parser.GetAcquisitionGantryTilt() |
| 124 | - localization = parser.GetImageLocation() | |
| 125 | 124 | |
| 126 | 125 | if (parser.GetImageThickness()): |
| 127 | 126 | spacing.append(parser.GetImageThickness()) |
| ... | ... | @@ -136,7 +135,7 @@ class ivDicomGroups: |
| 136 | 135 | image_position, patient_position, |
| 137 | 136 | image_type,patient_name, |
| 138 | 137 | image_orientation_label, file, |
| 139 | - series_description, id_study, tilt, localization]) | |
| 138 | + series_description, id_study, tilt]) | |
| 140 | 139 | self.filelist = filelist |
| 141 | 140 | |
| 142 | 141 | def __GetInformations(self, ind): |
| ... | ... | @@ -161,14 +160,12 @@ class ivDicomGroups: |
| 161 | 160 | series_description = filelist[ind][9] |
| 162 | 161 | id_study = filelist[ind][10] |
| 163 | 162 | tilt = filelist[ind][11] |
| 164 | - localization = filelist[ind][12] | |
| 165 | 163 | |
| 166 | 164 | list = [image_number, serie_number, spacing, |
| 167 | 165 | image_position, patient_position, |
| 168 | 166 | image_type,patient_name, |
| 169 | 167 | image_orientation_label, file, |
| 170 | - series_description, id_study, tilt, | |
| 171 | - localization] | |
| 168 | + series_description, id_study, tilt] | |
| 172 | 169 | |
| 173 | 170 | return list |
| 174 | 171 | |
| ... | ... | @@ -314,7 +311,6 @@ class ivDicomGroups: |
| 314 | 311 | series_description = groups_dcm[key][0][y][9] |
| 315 | 312 | id_study = groups_dcm[key][0][y][10] |
| 316 | 313 | tilt = groups_dcm[key][0][y][11] |
| 317 | - localization = groups_dcm[key][0][y][12] | |
| 318 | 314 | |
| 319 | 315 | #Generate new key to dictionary |
| 320 | 316 | key_ = (image_pos[0], image_pos[1], image_pos[2]) |
| ... | ... | @@ -324,7 +320,7 @@ class ivDicomGroups: |
| 324 | 320 | image_position, patient_position, |
| 325 | 321 | image_type,patient_name, |
| 326 | 322 | image_orientation_label, file, |
| 327 | - series_description, id_study, tilt, localization] | |
| 323 | + series_description, id_study, tilt] | |
| 328 | 324 | |
| 329 | 325 | #If list Null, create dictionary |
| 330 | 326 | #and add list with information |
| ... | ... | @@ -383,7 +379,6 @@ class ivDicomGroups: |
| 383 | 379 | series_description = tmp1[key][9] |
| 384 | 380 | id_study = tmp1[key][10] |
| 385 | 381 | tilt = tmp1[key][11] |
| 386 | - localization = tmp1[key][12] | |
| 387 | 382 | |
| 388 | 383 | new_key = (patient_name, None, x, image_orientation_label) |
| 389 | 384 | |
| ... | ... | @@ -392,8 +387,7 @@ class ivDicomGroups: |
| 392 | 387 | image_position, patient_position, |
| 393 | 388 | image_type,patient_name, |
| 394 | 389 | image_orientation_label, file, |
| 395 | - series_description, id_study, tilt, | |
| 396 | - localization] | |
| 390 | + series_description, id_study, tilt] | |
| 397 | 391 | |
| 398 | 392 | |
| 399 | 393 | if (new_key in groups_dcm_.keys()): | ... | ... |
invesalius/reader/dicom_reader.py
| ... | ... | @@ -71,12 +71,11 @@ def LoadImages(dir_): |
| 71 | 71 | tilt = groups[key][0][x][11] |
| 72 | 72 | spacing = groups[key][1][14] |
| 73 | 73 | spacing_z = groups[key][1][30] |
| 74 | - localization = groups[key][0][x][12] | |
| 75 | - | |
| 74 | + orientation = groups[key][0][x][7] | |
| 75 | + | |
| 76 | 76 | files = file_list |
| 77 | - #Coronal or Sagital with | |
| 78 | - #localization None Crash. necessary verify | |
| 79 | - if (localization): | |
| 77 | + #Coronal Crash. necessary verify | |
| 78 | + if (orientation <> "CORONAL"): | |
| 80 | 79 | #Organize reversed image |
| 81 | 80 | sorter = gdcm.IPPSorter() |
| 82 | 81 | sorter.SetComputeZSpacing(True) | ... | ... |