Skip to content

Commit

Permalink
split out polyline
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed May 15, 2024
1 parent ea71d21 commit 4443686
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DicomAnnotUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def dicomToCamic(annot_path, image_dimensions, output_file, source_url=None, sli
#print('len(points)', len(points))
if len(points) > 0:
newFeature = deepcopy(featureTemplate)
if x.GraphicType == "POLYLINE":
newFeature['geometry']['type'] = "Polyline"
newFeature['geometry']['coordinates'].append(points.tolist())
bounding_box = _makeBound(points)
# [[min_x, min_y], [min_x, max_y], [max_x, max_y], [max_x, min_y],[min_x, min_y]]
Expand All @@ -404,6 +406,8 @@ def dicomToCamic(annot_path, image_dimensions, output_file, source_url=None, sli
points = np.concatenate((points, [points[0]]))
if len(points) > 0:
newFeature = deepcopy(featureTemplate)
if x.GraphicType == "POLYLINE":
newFeature['geometry']['type'] = "Polyline"
newFeature['geometry']['coordinates'].append(points.tolist())
bounding_box = _makeBound(points)
# [[min_x, min_y], [min_x, max_y], [max_x, max_y], [max_x, min_y],[min_x, min_y]]
Expand All @@ -424,6 +428,8 @@ def dicomToCamic(annot_path, image_dimensions, output_file, source_url=None, sli
points = coordinates_array
points = np.concatenate((points, [points[0]]))
newFeature = deepcopy(featureTemplate)
if x.GraphicType == "POLYLINE":
newFeature['geometry']['type'] = "Polyline"
newFeature['geometry']['coordinates'].append(points.tolist())
bounding_box = _makeBound(points)
# [[min_x, min_y], [min_x, max_y], [max_x, max_y], [max_x, min_y],[min_x, min_y]]
Expand Down

0 comments on commit 4443686

Please sign in to comment.