Open rijobro opened 4 years ago
Potential problem noted here: https://github.com/UCL/STIR/pull/580.
Seems to me that
PresmoothingForwardProjectorByBin::set_input
should apply the data-processor and then use the output for ForwardProjectorByBin::set_input
. This class has to mimic whatever we did for the base class.
set_up()
stores images but only for geometric info. Their actual image values should never be used. (hence the comments should use Info
only).
Obviously, this implies that set_input
should first call set_up
for the data processor.
I also think that the objects will be shared across multiple PreSmoothing
and PostSmoothing
forward and back projectors. What happens if you do:
pre_smoothing_forward_projector_1->set_input(...);
pre_smoothing_forward_projector_2->set_input(...);
pre_smoothing_forward_projector_1->forward(...);
Since they share the same original_forward_projector_ptr
, I would expect the forward projection to project the image that was used in the second projectors set_input
.
hmmm. seems you're right. need some thought
These projectors contain the original projector, whilst themselves inheriting from the projector class. As far as I can tell, this will result in duplication of objects. For example, when we call
set_up
for the forward projector, we do the following:So now there is a copy of the
DiscretisedDensity
in both thePresmoothingForwardProjectorByBin
class and also inoriginal_forward_projector_ptr
.Before forward projecting, we call
set_input
. At this point, the data processor will be called on theDiscretisedDensity
inside ofPresmoothingForwardProjectorByBin
. However, when we forward project, we do the following:It looks like, here, the
DiscretisedDensity
inside oforiginal_forward_projector_ptr
gets projected. I don't think the data processor will have been applied to this image, so it will just be a normal forward projection. Further, I can't imagine thatset_input
will modify theDiscretisedDensity
inside oforiginal_forward_projector_ptr
, so perhaps the image will never change.The back projector presumably has a similar problem. Notably,
start_accumulating_in_new_image
won't start accumulating in a new image.I'm rather confused on this one, and I hope I've made a mistake somewhere.
If I'm not mistaken, I would vote removing the
PreSmoothing
andPostSmoothing
forward and back projectors altogether.