STIR
STIR copied to clipboard
lm_to_projdata creates PET interfile eventhough the template is for NM data
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
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()
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
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.