Skip to content
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

EstimateScatter forces the use of ForwardProjectorByBinUsingProjMatrixByBin for mask computation #1527

Open
robbietuk opened this issue Oct 25, 2024 · 2 comments · May be fixed by #1530
Open
Assignees

Comments

@robbietuk
Copy link
Collaborator

Attempting to estimate scatter from a CT attenuation map, many small voxels.

This leads to an issue with the ForwardProjectorByBinUsingProjMatrixByBin as

if (fabs(num_planes_per_scanner_ring_float - num_planes_per_scanner_ring) > 1.E-2)
error(boost::format("DataSymmetriesForBins_PET_CartesianGrid can currently only support z-grid spacing "
"equal to the ring spacing of the scanner divided by an integer. Sorry. "
"(Image z-spacing is %1% and ring spacing is %2%)")
% image_plane_spacing % proj_data_info_cyl_ptr->get_ring_spacing());
}

I am generally using parallelproj that avoids this issue elsewhere in the code base (no symmetries) but estimate_scatter forces the use of ForwardProjectorByBinUsingProjMatrixByBin when computing the mask projection data.

shared_ptr<ForwardProjectorByBin> forw_projector_sptr;
shared_ptr<ProjMatrixByBin> PM(new ProjMatrixByBinUsingRayTracing());
forw_projector_sptr.reset(new ForwardProjectorByBinUsingProjMatrixByBin(PM));


Two options

  1. Pre-compute and set the mask projdata before setup is called.
  2. Add a settable member forward projector shared pointer to the EstimateScatter class.

@KrisThielemans thoughts? Estimate scatter is already complex and convoluted, the second option adds more but simplifies. It can default to the current behavior.

@KrisThielemans
Copy link
Collaborator

sure, adding a settable member, also parsable, would be good. It doesn't really increase complexity of the code, so I'd be happy to consider a PR :-)

@KrisThielemans
Copy link
Collaborator

Of course, the scatter simulation itself would very much benefit from using parallelproj as well, but that's quite a lot of work. (need to "batch all line integrals up", while currently we do them one by one).

@robbietuk robbietuk linked a pull request Oct 28, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants