Closed mathiser closed 1 year ago
I have opened #39 in relation to the edge issue. I'm just showing here, what the conversion from #39 looks like with the method presented in this PR.
Dicom:
Nifti
@mathiser this looks like an excellent contribution to this tool and it would probably warrant a new version release. I will probably add a flag so that others can use the old behavior just in case. I think it would be good to have this as the new default behavior.
Before I add this new logic, would you mind sharing the example RT-Structs so that they can be included in the unit tests? If the RT-Structs are not available in a public server already then perhaps it could be possible to upload them to a separate GitHub repository?
Hi @Sikerdebaard, Sorry for the latency. I'll check if I can share the RTSTRUCT today. I'm a little in doubt if there are any sensitive tags in there. If not, do you then have some scan which you use for testing in other parts of the code that I can use? I can easily produce a new RTSTRUCT for testing purposes.
Mathis
If not, do you then have some scan which you use for testing in other parts of the code that I can use? I can easily produce a new RTSTRUCT for testing purposes.
The current unit tests use the stwstrategyhn1 dataset on the bmia xnat.
Let me know if you need help downloading from this server.
Brilliant. I'm just gonna select the first one and redo the examples. I'll send it over later today.
I made these examples on the CT of HN1004_20190403_CT. I attached conversions of both the original method and new proposed method - including a contour which fails in both methods. The examples are made in Slicer. I suspect the reason for the failures is that contour coordinates are not put at the edge if the brush exits the image frame. It may be different in other TPSs.
Kind regards, Mathis
Dear Thomas, Here comes a pull request to support holes in contours. It is a simple xor logic when overriding the sequences. I have added my test images below, showing that it works for complex structures.
In DICOM:
In Nifti:
A wave in Nifti
It does not work if a contour goes all the way the the edge. It seems that this is a problem which also exist with the current code. I'm opening this as an issue later today.
Apart from this update I have suggested to move the sitk.GetImageFromArray()-call to the very end of the function. This call is notoriously slow, and is called redundantly many times now.
Kind regards, Mathis Rasmussen