diff --git a/invesalius/reader/dicom_grouper.py b/invesalius/reader/dicom_grouper.py index c5c864f..b9cdd5c 100644 --- a/invesalius/reader/dicom_grouper.py +++ b/invesalius/reader/dicom_grouper.py @@ -121,6 +121,7 @@ class ivDicomGroups: spacing = parser.GetPixelSpacing() id_study = parser.GetStudyID() tilt = parser.GetAcquisitionGantryTilt() + localization = parser.GetImageLocation() if (parser.GetImageThickness()): spacing.append(parser.GetImageThickness()) @@ -135,7 +136,7 @@ class ivDicomGroups: image_position, patient_position, image_type,patient_name, image_orientation_label, file, - series_description, id_study, tilt]) + series_description, id_study, tilt, localization]) self.filelist = filelist def __GetInformations(self, ind): @@ -160,12 +161,14 @@ class ivDicomGroups: series_description = filelist[ind][9] id_study = filelist[ind][10] tilt = filelist[ind][11] + localization = filelist[ind][12] list = [image_number, serie_number, spacing, image_position, patient_position, image_type,patient_name, image_orientation_label, file, - series_description, id_study, tilt] + series_description, id_study, tilt, + localization] return list @@ -311,6 +314,7 @@ class ivDicomGroups: series_description = groups_dcm[key][0][y][9] id_study = groups_dcm[key][0][y][10] tilt = groups_dcm[key][0][y][11] + localization = groups_dcm[key][0][y][12] #Generate new key to dictionary key_ = (image_pos[0], image_pos[1], image_pos[2]) @@ -320,7 +324,7 @@ class ivDicomGroups: image_position, patient_position, image_type,patient_name, image_orientation_label, file, - series_description, id_study, tilt] + series_description, id_study, tilt, localization] #If list Null, create dictionary #and add list with information @@ -379,6 +383,7 @@ class ivDicomGroups: series_description = tmp1[key][9] id_study = tmp1[key][10] tilt = tmp1[key][11] + localization = tmp1[key][12] new_key = (patient_name, None, x, image_orientation_label) @@ -387,7 +392,8 @@ class ivDicomGroups: image_position, patient_position, image_type,patient_name, image_orientation_label, file, - series_description, id_study, tilt] + series_description, id_study, tilt, + localization] if (new_key in groups_dcm_.keys()): diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index 4bd7082..8c0eb0a 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -71,17 +71,20 @@ def LoadImages(dir_): tilt = groups[key][0][x][11] spacing = groups[key][1][14] spacing_z = groups[key][1][30] - - - #Organize reversed image - sorter = gdcm.IPPSorter() - sorter.SetComputeZSpacing(True) - sorter.SetZSpacingTolerance(1e-10) - sorter.Sort(file_list) - - #Getting organized image - files = sorter.GetFilenames() - + localization = groups[key][0][x][12] + + files = file_list + #Coronal or Sagital with + #localization None Crash. necessary verify + if (localization): + #Organize reversed image + sorter = gdcm.IPPSorter() + sorter.SetComputeZSpacing(True) + sorter.SetZSpacingTolerance(1e-10) + sorter.Sort(file_list) + #Getting organized image + files = sorter.GetFilenames() + array = vtk.vtkStringArray() img_app = vtk.vtkImageAppend() @@ -121,7 +124,7 @@ def LoadImages(dir_): img_axial.Update() - + return img_axial, acquisition_modality, tilt def GetDicomFiles(path, recursive = False): -- libgit2 0.21.2