Skip to content

Commit

Permalink
Round contour.ContourData to 10 decimal places (qurit#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaroberts committed Feb 28, 2023
1 parent 1561072 commit 769acd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rt_utils/ds_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def create_contour(series_slice: Dataset, contour_data: np.ndarray) -> Dataset:
contour.NumberOfContourPoints = (
len(contour_data) / 3
) # Each point has an x, y, and z value
contour.ContourData = contour_data

# Rounds ContourData to 10 decimal places to ensure it is <16 bytes length, as per NEMA DICOM standard guidelines.
contour.ContourData = [round(val, 10) for val in contour_data]

return contour

Expand Down

0 comments on commit 769acd6

Please sign in to comment.