diff --git a/invesalius/i18n.py b/invesalius/i18n.py index 44ba76b..d952fa7 100644 --- a/invesalius/i18n.py +++ b/invesalius/i18n.py @@ -20,7 +20,11 @@ # detalhes. #-------------------------------------------------------------------------- -import ConfigParser +try: + import configparser as ConfigParser +except(ImportError): + import ConfigParser + import locale import gettext import os diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index d07d26e..843fd94 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -1439,6 +1439,20 @@ class Parser(): return data return "" + def GetManufacturerName(self): + """ + Return Manufacturer of the equipment that produced + the composite instances. + """ + try: + data = self.data_image[str(0x0008)][str(0x0070)] + except(KeyError): + return "" + + if (data): + return data + return "" + def GetEquipmentManufacturer(self): """ Return manufacturer name (string). diff --git a/invesalius/reader/dicom_grouper.py b/invesalius/reader/dicom_grouper.py index b4f56b7..ad68d0e 100644 --- a/invesalius/reader/dicom_grouper.py +++ b/invesalius/reader/dicom_grouper.py @@ -111,7 +111,7 @@ class DicomGroup: filelist = [dicom.image.file for dicom in self.slices_dict.values()] - + # Sort slices using GDCM if (self.dicom.image.orientation_label <> "CORONAL"): #Organize reversed image @@ -121,10 +121,12 @@ class DicomGroup: sorter.Sort(filelist) filelist = sorter.GetFilenames() - #Getting organized image + # for breast-CT of koning manufacturing (KBCT) + if self.slices_dict.values()[0].parser.GetManufacturerName() == "Koning": + filelist.sort() + return filelist - def GetHandSortedList(self): # This will be used to fix problem 1, after merging # single DicomGroups of same study_id and orientation -- libgit2 0.21.2