Skip to content

Instantly share code, notes, and snippets.

@asim-shrestha
Last active February 2, 2021 19:01
Show Gist options
  • Save asim-shrestha/d31b9b40307994d12632110d04efe633 to your computer and use it in GitHub Desktop.
Save asim-shrestha/d31b9b40307994d12632110d04efe633 to your computer and use it in GitHub Desktop.
from rt_utils import RTStructBuilder
rtstruct = RTStructBuilder.create_new(dicom_series_path="./testlocation")
# ...
# Create mask through means such as ML
# ...
# Add the 3D mask as an ROI.
# The colour, description, and name will be auto generated
rtstruct.add_roi(mask=MASK_FROM_ML_MODEL)
# Add another ROI, this time setting the color, description, and name
rtstruct.add_roi(
mask=MASK_FROM_ML_MODEL,
color=[255, 0, 255],
name="RT-Utils ROI!"
)
rtstruct.save('new-rt-struct')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment