STIR icon indicating copy to clipboard operation
STIR copied to clipboard

lm_to_projdata creates PET interfile eventhough the template is for NM data

Open danieldeidda opened this issue 3 years ago • 3 comments

I just noticed that when running lm_to_projadata for SPECT list mode data the output sinogram interfile is the one for PET. When reconstructing this data with SPECTUB the image is visibly distorted

danieldeidda avatar Sep 09 '21 13:09 danieldeidda

Interesting. I guess the related code is https://github.com/UCL/STIR/blob/329eeb717fd264919dfa1c640225b4c7ec1d62cc/src/listmode_buildblock/LmToProjData.cxx#L301-L304 and then https://github.com/UCL/STIR/blob/329eeb717fd264919dfa1c640225b4c7ec1d62cc/src/listmode_buildblock/LmToProjData.cxx#L139-L143 which seems simple enough.

Those seem to be OK. The issue arises when calling construct_proj_data()

robbietuk avatar Sep 10 '21 01:09 robbietuk

Actually it seems even the following: template_proj_data_info_ptr.reset(template_proj_data_ptr->get_proj_data_info_sptr()->clone()); line 214

contains ProjDataInfoCylindrical which it should not for SPECT

danieldeidda avatar Sep 21 '21 16:09 danieldeidda

Looks like we check modality to determine if we should write a SPECT Interfile header: https://github.com/UCL/STIR/blob/07aad4371043136f6d2f0ee63893cfabb6e5104b/src/IO/interfile.cxx#L1191

This implies that the modality info is wrong. I do notice that in general we have a lot of warnings about "unknown modality", which is weird.

KrisThielemans avatar Nov 17 '21 15:11 KrisThielemans