Commit 72858e0b66a91142c9d40ce3aaecace71368d33d
1 parent
83bd621f
Exists in
master
and in
12 other branches
FIX: Fixed problems with import KBCT (Koning Breast CT) and Anatomage
Showing
3 changed files
with
24 additions
and
4 deletions
Show diff stats
invesalius/i18n.py
| ... | ... | @@ -20,7 +20,11 @@ |
| 20 | 20 | # detalhes. |
| 21 | 21 | #-------------------------------------------------------------------------- |
| 22 | 22 | |
| 23 | -import ConfigParser | |
| 23 | +try: | |
| 24 | + import configparser as ConfigParser | |
| 25 | +except(ImportError): | |
| 26 | + import ConfigParser | |
| 27 | + | |
| 24 | 28 | import locale |
| 25 | 29 | import gettext |
| 26 | 30 | import os | ... | ... |
invesalius/reader/dicom.py
| ... | ... | @@ -1439,6 +1439,20 @@ class Parser(): |
| 1439 | 1439 | return data |
| 1440 | 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 | 1456 | def GetEquipmentManufacturer(self): |
| 1443 | 1457 | """ |
| 1444 | 1458 | Return manufacturer name (string). | ... | ... |
invesalius/reader/dicom_grouper.py
| ... | ... | @@ -111,7 +111,7 @@ class DicomGroup: |
| 111 | 111 | |
| 112 | 112 | filelist = [dicom.image.file for dicom in |
| 113 | 113 | self.slices_dict.values()] |
| 114 | - | |
| 114 | + | |
| 115 | 115 | # Sort slices using GDCM |
| 116 | 116 | if (self.dicom.image.orientation_label <> "CORONAL"): |
| 117 | 117 | #Organize reversed image |
| ... | ... | @@ -121,10 +121,12 @@ class DicomGroup: |
| 121 | 121 | sorter.Sort(filelist) |
| 122 | 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 | 128 | return filelist |
| 126 | 129 | |
| 127 | - | |
| 128 | 130 | def GetHandSortedList(self): |
| 129 | 131 | # This will be used to fix problem 1, after merging |
| 130 | 132 | # single DicomGroups of same study_id and orientation | ... | ... |