platipy icon indicating copy to clipboard operation
platipy copied to clipboard

Conversion of dicom structure to nii.gz doesn't retain holes in structure

Open nickhardcastle opened this issue 1 year ago • 1 comments

Hi team,

When using convert_rtstruct, if there's a hole in the structure in the dicom, this isn't retained. The resultant nii.gz fills in the hole in the structure.

I noticed this while converting ring structures.

Cheers,

Nick

nickhardcastle avatar Nov 21 '23 23:11 nickhardcastle

Thanks for reporting this @nickhardcastle! We will look into it.

pchlap avatar Nov 23 '23 02:11 pchlap

Hi, any update on this? We've got some new datasets in TCIA where this is an issue.

Btw, it's super cool that you built in support to pull data from us directly! I'm planning to advertise this in of our social media posts sometime soon :-)

kirbyju avatar May 17 '24 02:05 kirbyju

Hi @kirbyju, thanks for reaching out. To be honest both @rnfinnegan and I have been caught up with other things. But hopefully this is something that would be fairly straightforward to resolve.

@rnfinnegan when we catch up in a couple of weeks can we discuss how to do this? It would be good to have a sample RTSTRUCT to use for development? Perhaps you could generate something on a phantom? Once we have that I think it should be fairly easy to adapt our function to support this.

@kirbyju we'll keep you posted on how it goes :)

pchlap avatar May 20 '24 22:05 pchlap

Hi @kirbyju, @nickhardcastle,

Sorry for the delay in fixing this issue. @rnfinnegan and I had a chance to meet yesterday to debug this. Turns out the solution was pretty simple! (See #271).

Rob created a test dataset using Eclipse for us to test this. But it might be good to get some more test data to confirm this fixes the issue entirely. Do either of you have data you might be able to share? Alternatively would it be feasible to test out the fix before we build a release? I will aim to generate some test data using MIM and RF AutoContour this weekend.

Rob and I will address a few other minor issues and will prepare a new release of platipy including this fix in about 3-4 weeks.

pchlap avatar Jun 12 '24 12:06 pchlap

Check out https://github.com/brianmanderson/Slicer_RT_Target_Issue/blob/main/Slicer_Target_Issue.ipynb, which I believe was put together to help test this same issue in SlicerRT. I will take a look at some of the tumor segmentation RTSTRUCT data we have in TCIA to see if I can find a few examples for you to test from there as well.

kirbyju avatar Jun 13 '24 13:06 kirbyju

I think this one would be useful to try. You can download it here: https://nbia.cancerimagingarchive.net/nbia-search/?saved-cart=nbia-31061718290468281

Screenshot 2024-06-13 at 10 05 44 AM

kirbyju avatar Jun 13 '24 14:06 kirbyju

I think this one would be useful to try. You can download it here: https://nbia.cancerimagingarchive.net/nbia-search/?saved-cart=nbia-31061718290468281

Thanks @kirbyju, this TCIA example seems to convert fine. However there isn't a hole in this particular structure, just 2d islands which platipy is converting to a mask fine. Or have I missed something?

I also tested this today with an RTSTRUCT generated in MIM and RF AutoContour where I created a strucutre with a hole inside. These holes are now appearing in the masks generated.

pchlap avatar Jun 15 '24 19:06 pchlap

My mistake, wasn't thinking straight. Glad it seems to be working in all circumstances though!

kirbyju avatar Jun 16 '24 16:06 kirbyju