Skip to content

Changes needed for Total-Body - #45

Closed
arnaufme8 wants to merge 23 commits into
txusser:developfrom
arnaufme8:develop
Closed

arnaufme8 wants to merge 23 commits into
txusser:developfrom
arnaufme8:develop

Conversation

@arnaufme8

@arnaufme8 arnaufme8 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

The changes in this pull request mainly are needed for simulating in Total-Body (TB) with SimPET. Some of them may also optimise or add new functionalities to the old version of SimPET. Main upgrades include:

  • SimSET has been slightly updated. Some source files have been updated (most changes thanks to Robert Harrison) and do not imply changes in the functionality, but on the memory management (from 4-bytes to 8-bytes variables). No compatibility issues should appear.

  • STIR newest version is now installed (v6.4). This update is necessary as old version cannot reconstruct TB. Furthermore, it is faster and has few new functionalities.

  • SimPET's management of files had to be adapted to potentially extremely large matrixes generated by TB. To do so, all Analyze files involved in the process have been converted now to Nifti2, which can handle such big matrixes. To do so, functions in utils/tools (i.e., create_nifti_from_imgdata(), convert_hv_to_nii(), operate_single_image_nii(), operate_images_nii(), operate_sinograms_nii(), convert_simset_sino_to_stir_nii()) are new versions of their respective old versions changing the extensions of which their work. In some cases (e.g., convert_simset_sino_to_stir_nii()) or operate_images_nii()) other changes have been introduced to optimise and make the processing much faster and less memory consuming, which was not important for smaller sinograms. Unused processes in some situations (e.g., additive sinogram if no scatter correction is done) are also computed only if necessary, saving much time and space.

  • Attenuation correction by using an attenuation sinogram generated by STIR is now implemented. To do this, the following steps are added in simset_sim script: converting the values of the attenuation map to attenuation coefficients by reading the SimSET tables (mu_map), forward projecting this map and computing the ACF with STIR. Although SimSET's calcattenuation is still available, it is not feasible for TB due to large computation times, and even for short scanners STIR correction is preferred. The type of correction is controlled by scanner's parameter attenuation_mode.

  • Due to the use of STIR sinograms, we realized that SimSET and STIR sinograms are disaligned. Until now this wasn't important as both sinograms came from SimSET. We added a flip in Y in the SimSET to align both sinograms (NOTE: further tests need to be done). As a result of this, reconstructed images also appear flipped by default, so a function to flip the reconstructions to align the maps is also implemented in utils/tools.

  • Listmode is now fully implemented: listmode (phg at the moment) is computed in each division, merged and the unified listmode is then binned through the SimSET binning's module (potentially large times, needs to be optimized). This allows to make as much divisions as desired with TB (if ran in sinogram mode, RAM consumption is prohibitive) and then the RAM consuming moment is just reserved for the binning process. Once the sinogram is built, the rest of the process is the same.

  • Other minor, non-related with TB improvements include: fixes on FBP (the problem is identified, as this algorithm in STIR requires the cutted sinograms, and a function to fix this is already implemented, but needs to be implemented in the main body) and PSF (not used in TB).

  • Concerning installing process of SimPET, we realized that current version requires to have sudo available even if not used. This may be problematic when aiming to use SimPET in public clusters such as HCP, which is now more needed due to high requirements for TB. Thus, we add an alternative makefile (makefile-withoutsudo) which can substitute current makefile if needed for installation in HCPs, as explained in the README.

Comment thread submodules/simset_simpet

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to do a separate Pull Request to update simset_simpet that incorporating the changes here

@txusser

txusser commented Jul 28, 2026

Copy link
Copy Markdown
Owner

The automatic NEMA stuff is missing :(

@txusser txusser closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants