Resetting folder#

If you want to run the analysis from a clean slate, you can use turbo_reset_subject_dir(subject).

Important

This permanently deletes all result files. Use with caution.

Note

turbo_reset_subject_dir() uses the same enviroment variable getenv('TOTAL_BODY_PET_DATA_DIR') and deletes files from the folder at [getenv('TOTAL_BODY_PET_DATA_DIR') '/' subject].

turbo_reset_subject_dir('123456_rest')

This wipes all files except the following:

  • pet/subject_pet.nii or .nii.gz

  • pet/subject_pet.json

  • anat/subject_ct.nii or .nii.gz

  • anat/subject_ct.json

  • anat/subject_ct_segmentations.nii or .nii.gz (optional)

  • anat/subject_ct_segmentations_heart.nii or .nii.gz (optional)

  • log_files/* (optional)

  • options/* (optional)

The folder should now look like this:

../_images/reset1.png

By default segmentation files, log files and options structs are not deleted. These can be deleted by setting flags

  • delete_segmentations = 1

  • delete_logs = 1

  • delete_options = 1

turbo_reset_subject_dir('123456_rest',                         delete_segmentations = 1, ...
                        delete_logs = 1,                         delete_options = 1)

Now the folder should look like this:

../_images/reset2.png

If you wish to preserve for example log files but delete segmentations and options, you can omit delete_logs as the default value is 0, or explicitly set delete_logs = 0.