Commit 6063c678f39147b20224a217d1084006919421d0
1 parent
645c7d0a
Exists in
master
and in
68 other branches
ENH: WW/WL slices initial value(fix #149)
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
invesalius/reader/dicom_grouper.py
@@ -80,6 +80,7 @@ class DicomGroup: | @@ -80,6 +80,7 @@ class DicomGroup: | ||
80 | def AddSlice(self, dicom): | 80 | def AddSlice(self, dicom): |
81 | if not self.dicom: | 81 | if not self.dicom: |
82 | self.dicom = dicom | 82 | self.dicom = dicom |
83 | + | ||
83 | pos = tuple(dicom.image.position) | 84 | pos = tuple(dicom.image.position) |
84 | 85 | ||
85 | #Case to test: \other\higroma | 86 | #Case to test: \other\higroma |
@@ -151,7 +152,9 @@ class DicomGroup: | @@ -151,7 +152,9 @@ class DicomGroup: | ||
151 | self.zspacing = 1 | 152 | self.zspacing = 1 |
152 | 153 | ||
153 | def GetDicomSample(self): | 154 | def GetDicomSample(self): |
154 | - return self.dicom | 155 | + size = len(self.slices_dict) |
156 | + dicom = self.GetHandSortedList()[size/2] | ||
157 | + return dicom | ||
155 | 158 | ||
156 | class PatientGroup: | 159 | class PatientGroup: |
157 | def __init__(self): | 160 | def __init__(self): |