Skip to content

BUG: Match CUDA forward projection clipping with CPU behaviour - #981

Merged
SimonRit merged 2 commits into
RTKConsortium:mainfrom
maxime-y-monin:fix-forward-projector-clipping
Aug 21, 2026
Merged

BUG: Match CUDA forward projection clipping with CPU behaviour#981
SimonRit merged 2 commits into
RTKConsortium:mainfrom
maxime-y-monin:fix-forward-projector-clipping

Conversation

@maxime-y-monin

Copy link
Copy Markdown

Fixes #980

@SimonRit SimonRit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work, this is great. In addition to my comments below, can you also add a note in documentation/docs/rtk_3_migration_guide.md to indicate the change of behavior. I would also squash the changes in one commit and call this an enhancement (change of behavior) rather than a bug but it's probably a matter of opinion.

Comment thread src/rtkCudaForwardProjectionImageFilter.cu
Comment thread src/rtkCudaForwardProjectionImageFilter.cu
@maxime-y-monin
maxime-y-monin force-pushed the fix-forward-projector-clipping branch 2 times, most recently from 9548ff7 to c33bff8 Compare August 20, 2026 08:08

@SimonRit SimonRit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the work. Good as is but we need to update rtkCudaRayCastBackProjectionImageFilter.cu accordingly. Do you want to do it in this PR or do you want us to do it in a subsequent PR?

Comment thread src/rtkCudaForwardProjectionImageFilter.cu
Comment thread src/rtkCudaForwardProjectionImageFilter.cu
The CUDA forward projector integrated along an infinite ray,
allowing attenuation located beyond the detector plane to
contribute to the projection.

Clip the integration interval to the source-detector segment,
matching the behavior of the CPU Joseph forward projector.

Add a regression test covering volumes located before, on and
beyond the detector.
Restrict CUDA back projection to the source-detector segment,
similarly to the CPU implementation.

This avoids accumulating contributions beyond the physical ray
segment and keeps the back projector consistent with the
corresponding forward projector, preserving the adjoint relationship.
@maxime-y-monin
maxime-y-monin force-pushed the fix-forward-projector-clipping branch from c33bff8 to 4e56fbd Compare August 20, 2026 16:09
@maxime-y-monin

Copy link
Copy Markdown
Author

Thanks again for the work. Good as is but we need to update rtkCudaRayCastBackProjectionImageFilter.cu accordingly. Do you want to do it in this PR or do you want us to do it in a subsequent PR?

I added a separate commit for the adjoint operator. It includes a regression test that passes only after the corresponding clipping changes in rtkCudaRayCastBackProjectionImageFilter.cu. Let me know if you think this needs further changes.

@SimonRit SimonRit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will merge when the CI's green.

@SimonRit
SimonRit merged commit c8a8c04 into RTKConsortium:main Aug 21, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray may accumulate past the detector in rtkCudaForwardProjectionImageFilter.cu

3 participants