Commit 72858e0b66a91142c9d40ce3aaecace71368d33d

Authored by Paulo Henrique Junqueira Amorim
1 parent 83bd621f

FIX: Fixed problems with import KBCT (Koning Breast CT) and Anatomage

invesalius/i18n.py
@@ -20,7 +20,11 @@ @@ -20,7 +20,11 @@
20 # detalhes. 20 # detalhes.
21 #-------------------------------------------------------------------------- 21 #--------------------------------------------------------------------------
22 22
23 -import ConfigParser 23 +try:
  24 + import configparser as ConfigParser
  25 +except(ImportError):
  26 + import ConfigParser
  27 +
24 import locale 28 import locale
25 import gettext 29 import gettext
26 import os 30 import os
invesalius/reader/dicom.py
@@ -1439,6 +1439,20 @@ class Parser(): @@ -1439,6 +1439,20 @@ class Parser():
1439 return data 1439 return data
1440 return "" 1440 return ""
1441 1441
  1442 + def GetManufacturerName(self):
  1443 + """
  1444 + Return Manufacturer of the equipment that produced
  1445 + the composite instances.
  1446 + """
  1447 + try:
  1448 + data = self.data_image[str(0x0008)][str(0x0070)]
  1449 + except(KeyError):
  1450 + return ""
  1451 +
  1452 + if (data):
  1453 + return data
  1454 + return ""
  1455 +
1442 def GetEquipmentManufacturer(self): 1456 def GetEquipmentManufacturer(self):
1443 """ 1457 """
1444 Return manufacturer name (string). 1458 Return manufacturer name (string).
invesalius/reader/dicom_grouper.py
@@ -111,7 +111,7 @@ class DicomGroup: @@ -111,7 +111,7 @@ class DicomGroup:
111 111
112 filelist = [dicom.image.file for dicom in 112 filelist = [dicom.image.file for dicom in
113 self.slices_dict.values()] 113 self.slices_dict.values()]
114 - 114 +
115 # Sort slices using GDCM 115 # Sort slices using GDCM
116 if (self.dicom.image.orientation_label <> "CORONAL"): 116 if (self.dicom.image.orientation_label <> "CORONAL"):
117 #Organize reversed image 117 #Organize reversed image
@@ -121,10 +121,12 @@ class DicomGroup: @@ -121,10 +121,12 @@ class DicomGroup:
121 sorter.Sort(filelist) 121 sorter.Sort(filelist)
122 filelist = sorter.GetFilenames() 122 filelist = sorter.GetFilenames()
123 123
124 - #Getting organized image 124 + # for breast-CT of koning manufacturing (KBCT)
  125 + if self.slices_dict.values()[0].parser.GetManufacturerName() == "Koning":
  126 + filelist.sort()
  127 +
125 return filelist 128 return filelist
126 129
127 -  
128 def GetHandSortedList(self): 130 def GetHandSortedList(self):
129 # This will be used to fix problem 1, after merging 131 # This will be used to fix problem 1, after merging
130 # single DicomGroups of same study_id and orientation 132 # single DicomGroups of same study_id and orientation