-
-
Notifications
You must be signed in to change notification settings - Fork 476
-
-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to export rt structure set #113
Comments
From darcymason@gmail.com on February 14, 2012 18:48:06
Yes it is ... see reply on the discussion group. |
From darcymason@gmail.com on February 15, 2012 17:55:16 Status: Verified |
@darcymason hi, I am also trying to export a rt file, but where is the discuss.. |
Can you be more specific please? Are you creating the file from scratch? There is an example in the repository showing what needs to be set for basic file writing. The discussion referred to was probably this one. Quite old, so the setting items issue should no longer be relevant. Anyway, my answer there gives a quick idea of how to assign down the nested structures to the ContourData. |
Oh, and there is the codify utility, which takes an existing file and produces a complete pydicom code to create that file. So find a DICOM file that is similar to your needs, and you can have an exact template for the code needed to make one like it. |
@darcymason , tks for this, I've just tried it, really awesome! |
Hey, though its been years since this thread was created, a team and I actually wrote a small Python package called RT-Utils that deals with easily creating RTStructs. If you already have series masks you would like segmented as contours, it should be a lot simpler than using the codify utility. You can find the package here for better documentation and you can install the package via pip. Sample code: from rt_utils import RTStructBuilder
# Create new RT Struct. Requires the DICOM series path for the RT Struct.
rtstruct = RTStructBuilder.create_new(dicom_series_path="./testlocation")
# Your code to generate the segmentation mask
segmentation_mask = get_segmentation_mask()
# Add the 3D mask as an ROI.
rtstruct.add_roi(mask=segmentation_mask)
# Save the resulting RT Struct
rtstruct.save('new-rt-struct') For further info, check out this blogpost. |
The link to the blog post seems to be dead. Is there a new location? |
@renatobellotti - I found the post and updated the link. |
Nice, thanks! This lools very interesting. 👍 |
From miki...@gmail.com on February 14, 2012 18:47:57
Is it possible to export contour data to dicom rt structure set right within this lib?
Thank you
Original issue: http://code.google.com/p/pydicom/issues/detail?id=112
The text was updated successfully, but these errors were encountered: