UCL / STIR

Software for Tomographic Image Reconstruction
http://stir.sourceforge.net/
Other
111 stars 93 forks source link

scatter_estimation.par template_projdata_filename not defined #1517

Open katerinachytra opened 2 hours ago

katerinachytra commented 2 hours ago

Using scatter_estimation.par without any modification raises the error ScatterSimulation: template energy window information not set. Aborting. Reading the user's manual and searching STIR repository on Github, it is not clear how to generate the template projdata needed. I also tried to load the emission data as a template data but the Scatter estimation calculation was aborted without any error message.

KrisThielemans commented 2 hours ago

Do you mean scatter_simulation.par? There is no need to specify a "template" for the scatter estimation (see https://github.com/UCL/STIR/tree/master/examples/samples/scatter_estimation_par_files) as the emission data will be downsampled first to generate the template.

katerinachytra commented 1 hour ago

Thank you for the quick response. I think I figured it out. It is necessary to set the energy window during unlisting (I have Gate ROOT output as an input.) to have values other than 0 and 10000 in the interfile header of the input sinogram both in Coincidences and Delays sinograms.

KrisThielemans commented 1 hour ago

I see that for scatter simulation, then in principle (but see below) you shouldn't have to create the template if you enable downsampling, i.e. change https://github.com/UCL/STIR/blob/6417022e54a4814f25776bc8ca1df3acd4e865f6/examples/samples/scatter_simulation.par#L22. This will choose sensible defaults for the downsampled scanner. There do exist parameters to tell it how to do the downsampling which are not listed in this example file, but you should be able to see them

I suspect that if you set the template to the emission data, that you are running out of memory for the caching. You could switch the caching off, but this will take a very long time!

Probable small bug

The set_up() function checks if the template is set BEFORE doing any downsampling. https://github.com/UCL/STIR/blob/6417022e54a4814f25776bc8ca1df3acd4e865f6/src/scatter_buildblock/ScatterSimulation.cxx#L308-L309 This doesn't make sense as its overridden during the downsampling anyway. https://github.com/UCL/STIR/blob/6417022e54a4814f25776bc8ca1df3acd4e865f6/src/scatter_buildblock/ScatterSimulation.cxx#L929 Work-around: set the template to the emission data anyway (but enable downsampling)