From 54bb053db6b4e2a27eff216b7a1677f4d6eba2a0 Mon Sep 17 00:00:00 2001 From: Gabriel Couture Date: Sun, 16 Dec 2018 21:11:47 -0500 Subject: [PATCH] dicomparser: Remove the test for existence of ContourImageSequence in GetStructureCoordinates Since this tag isn't required (Type 3) in DICOM RT Structure Set. Closes #80. --- dicompylercore/dicomparser.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/dicompylercore/dicomparser.py b/dicompylercore/dicomparser.py index de156b1..3be8daa 100755 --- a/dicompylercore/dicomparser.py +++ b/dicompylercore/dicomparser.py @@ -542,7 +542,7 @@ def GetStructureCoordinates(self, roi_number): # Locate the contour sequence for each referenced ROI for c in roi.ContourSequence: # For each plane, initialize a new plane dict - plane = {} + plane = dict() # Determine all the plane properties plane['type'] = c.ContourGeometricType @@ -550,15 +550,12 @@ def GetStructureCoordinates(self, roi_number): plane['data'] = \ self.GetContourPoints(c.ContourData) - # Each plane which coincides with an image slice - # will have a unique ID - if 'ContourImageSequence' in c: - # Add each plane to the planes dict - # of the current ROI - z = str(round(plane['data'][0][2], 2)) + '0' - if z not in planes: - planes[z] = [] - planes[z].append(plane) + # Add each plane to the planes dict + # of the current ROI + z = str(round(plane['data'][0][2], 2)) + '0' + if z not in planes: + planes[z] = [] + planes[z].append(plane) return planes