-
Notifications
You must be signed in to change notification settings - Fork 57
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
Gaussian smoothing #90
base: main
Are you sure you want to change the base?
Conversation
…ded adjustments for high res structure sets
… GaussianSmoothing
… GaussianSmoothing
… GaussianSmoothing
Really?! Not a single comment from maintainers? Perhaps it is time to expand the group of maintainers to make the repo a bit more active.... |
Hi @mathiser sorry about this. Thanks for such a high quality write up on this. Unfortunately @asim-shrestha and I have been tied up as of late working on our own startup (we actually left the qurit team close to three years ago). As such this project has seemed to fall through the cracks, which is a shame. Tagging the qurit team so this can get reviewed hopefully @carluri @ivankzn @qurit-frizi :) |
I do agree that this project needs an expanded set of maintainers so that great features like this can get in |
Thanks for your reply, @awtkns. I did suspect that the situation was something like this, which I totally understand. BTW,this PR was also opened in the hope that people could share some insights in the post-processing contours. It is quite likely that the style of coding is not appropriate in this repo - and I haven't added any tests either.... |
Lastly, I have done some more parameter tweaking and nursing on the code. I won't bother updating the PR if the interest is limited... |
Hi @mathiser , I have just joined the team and will be helping with maintenance and developing new features. It will take me a couple of weeks to get up to speed but I hope to start reviewing and supporting this project as much as possible. Thanks again for your contributions and for your patience. We really appreciate it! I'll be back into this PR soon. |
Dear everyone,
A thing that has bugged me when using this (otherwise wonderful) package, is the jagged, unsmooth and a bit too small contours which are returned, when converting binary masks into rtss.
In this PR I propose implementation of how smoothing can be added as an option. Essentially, it is iterations of applying the following filters.
How to run it
All you have to do is to run the usual add_roi() with another parameter:
Furthermore, you can tweak the smoothing by parsing a dict with parameters. The setup is a little curious, and there is room for improvement, but essentially it looks like this:
The above dict can be used by doing:
I have added the possibility to choose running the filters in either 3d or 2d. I have done most parameter tuning in 2d, and have come up with two sets, which works well, so if
Furthermore, this is a nice entry point to add other smoothing algorithms like:
Other things in the code
In order to be able to add upscaled masks, there is a check in rtstruct.addroi():
This determines the scale in X, Y which will then be taken into account in image_helper.find_mask_contours():
Show case
Because I work with clinical data, I do not show the underlying images. It does not matter for the impression, I guess.
Below is a image where red is the initial dicom rtss and in green is the same converted to binary nifti masks in CT-grid.
Converting the green nifti directly back to dicom rtss with the current main branch gives this, where red is ground truth and blue is the converted rtss:
With default parameters of this PR the same conversion yields the following, where red is ground truth and blue is conversion:
Purpose of the PR
I do not know what the maintainers thinks about implementing this into the standard package, but to me and my work, well-working smoothing is a game-changer. I hope we can discuss if other algorithms should be implemented too or if the interface should look different.
Looking forward to hear your thoughts,
Mathis