This folder contains the scripts to generate the lesion frequency map (LFM) in the PAM50 space.
Namely:
01_register_to_pam50.sh
: Register STIR/PSIR images to the PAM50 space and bring the GT lesion and spinal cord masks template space.02_generate_lesion_frequency_maps.py
: Generate the lesion frequency map (LFM) in the PAM50 space.03_lfm_to_png.py
: Save the LFM as a PNG image.
Register STIR/PSIR images to the PAM50 space and bring the GT lesion and spinal cord masks (located under
derivatives/labels
) to the PAM50 template space.
Run the script across all subjects using sct_run_batch
wrapper:
sct_run_batch -config config.json
Example config.json
file:
{
"path_data" : "<PATH_TO_DATASET>/canproco",
"path_output" : "<PATH_TO_DATASET>/canproco_register_to_PAM50_2023-10-21",
"script" : "<PATH_TO_REPO>/canproco/lesion-mapping/01_register_to_pam50.sh",
"jobs" : 16,
"exclude_list": "sub-mon118 sub-mon006 ..."
}
exclude_list
is used to exclude subjects from the processing, for example, due to artifacts or missing data.
The subjects in the exclude_list
are listed in the exclude.yml file.
Generate the lesion frequency map (LFM) in the PAM50 space.
ℹ️ The 02_generate_lesion_frequency_maps.py
script requires the SCT conda environment to be activated:
source ${SCT_DIR}/python/etc/profile.d/conda.sh
conda activate venv_sct
Run the script:
python 02_generate_lesion_frequency_maps.py \
-ifolder canproco_register_to_PAM50_2023-10-21/data_processed \
-participants-tsv canproco/participants.tsv \
-exclude-yml exclude_M0_M12_comparison.yml \
-ofolder canproco_register_to_PAM50_2023-10-21/results \
-session M0
From the Lesion Frequency Map (LFM), generate:
- axial png images for each vertebral level (average across axial slices for each vertebral level)
- a single sagittal png image (average across sagittal slices)
ℹ️ The 03_lfm_to_png.py
script requires the SCT conda environment to be activated:
source ${SCT_DIR}/python/etc/profile.d/conda.sh
conda activate venv_sct
Run the script:
python 03_lfm_to_png.py \
-lfm-path spinalcord_LFM_MS_200_participants.nii.gz \
-ofolder lfm \
-thr 0.15 \
-include-gm