STIR
STIR copied to clipboard
parallelproj backproj optimisation
At present, even if we do only a subset, or a single RelatedViewgram
, the CPU code will be backprojecting all of the data anyway as we pass all of it, see e.g. here
The parallelproj backprojector will not backproject zeroes, but it will have first copied all of the data to the GPU, which is costly.
Easiest work-around for now seems to make a copy in CPU memory of the relevant arrays with only the non-zero data, e.g.
- count number of non-zero entries
- allocate new arrays
- copy data
- call parallelproj_backproj
Alternatively we could keep a mask (updated in actual_back_project
) of viewgrams or bins, and do the copy based on the mask (would skip counting, but needs more memory and more code).
Related https://github.com/gschramm/parallelproj/issues/14