Open katerinachytra opened 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.
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.
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
ScatterSimulation
object and print(scatter_sim.parameter_info())
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!
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)
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.