-
Notifications
You must be signed in to change notification settings - Fork 145
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
ENH: MIP image filter for DRR image calculation #579
Conversation
Thank you for your contribution. Have you tried to avoid copy pasting the original code of Joseph's projector? It should not be necessary if one uses a functor. |
I've tried, but couldn't make it. Mainly because the SumAlongRay functor is a tally, in case of MIP we need a step with the maximum intensity not the sum of the steps along a ray. IMHO. |
I see. I guess including the sum as a reference parameter of SumAlongRay and doing the sum in the functor would solve this? |
Or doing a new |
I will try to use your suggestion, and use sum as a reference parameter in functor. |
Functor is changed, so copy-pasted part is removed.
Do you suggest of using lambdas instead of functors? |
Thanks! Looks better.
Yes, something like what's been done here for ITK unary image filters. It would make the code look nicer but I'm not sure it would be as efficient. To be tested... |
There are some style errors: I would also suggest to change name from MIPForwardProjectionImageFilter to MaximumIntensityProjectionImageFilter to follow ITK's guidelines to avoid abbreviations. |
I will fix these errors. |
Filter was renamed, and MIP filter was added to rtkforwardprojections application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and sorry for not getting back to you before. Can the MIP code be put in a separate include/MaximumIntensityProjectionImageFilter.h(xx) pair files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I think the code is ready to be merged. It would be good to add a test and the wrapping. If you are not willing to do them, please rebase on master and squash all commits in one. I'll then merge and do them in another PR. |
I can try. I'll let you know in case of problems. |
Is there a instruction how to test python wrapping? |
Ideally you can add a test similar to rtkFirstReconstruction.py and enable it here. Then you need to build RTK with testing and python wrapping enabled to be able to run the test with ctest |
Thanks @LucasGandel! I had forgotten about this. |
I have a question about writing a wrapper for MIP filter. I've taken as a basis the JosephForwardProjectionAttenuated wrapper, since both class are derived from JosephForwardProjection. My wrapper is
During the compilation there are multiple warning messages like below, as a result python packages can't be created.
Do you have a tutorial of some kind, how to write a wrapper for derived classes? |
The available tutorial is the ITK software guide section 9.5. The warning indicate that you already have an instance with the same name so you need to change the first paramter of the itk_wrap_template macro. |
It looks like compilation with python and tests are OK! Should i squash the commits into one? |
Yes please squash! I tested the wrapping and it works perfectly. Thanks! |
The MaximumIntensityForwardProjectionImageFilter is derived from JosephForwardProjectionImageFilter and computes maximum intensity step along the ray casting on the projection.
357cb1f
to
fe882ca
Compare
Squashed in one commit. |
Thanks for your contribution! |
MIPForwardProjectionImageFilter is derived from
JosephForwardProjectionImageFilter and computes maximum intensity step along the ray casting on the projection
Example with parallel geometry beam.
DRR image with JosephForwardProjectionImageFilter:
DRR image with MIPForwardProjectionImageFilter: