From 49d5adfa9a574909680fef738d83d033c55d3737 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 16 Oct 2020 18:15:17 -0400 Subject: [PATCH 1/8] resample t2w images to 1x1x1mm --- process_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_data.sh b/process_data.sh index 695b9d8..a1d9b1f 100755 --- a/process_data.sh +++ b/process_data.sh @@ -117,7 +117,7 @@ cd anat # Reorient to RPI and resample file if [ $contrast == "t2" ]; then contrast_str="T2w" - interp="0.8x0.8x0.8" + interp="1x1x1" elif [ $contrast == "t1" ]; then contrast_str="T1w" interp="1x1x1" From 8e3012e642b6c6baecc6015ea2785e2e71666b7c Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 16 Oct 2020 18:57:33 -0400 Subject: [PATCH 2/8] resample t2w images manual segmentation to 1x1x1mm --- process_data.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/process_data.sh b/process_data.sh index a1d9b1f..730cd44 100755 --- a/process_data.sh +++ b/process_data.sh @@ -82,10 +82,11 @@ segment_if_does_not_exist(){ local qc=$3 # Update global variable with segmentation file name FILESEG="${file}_seg" - FILESEGMANUAL="${path_derivatives}/${FILESEG}-manual.nii.gz" + FILESEGMANUAL="${path_derivatives}/${FILESEG}-manual" if [ -e $FILESEGMANUAL ]; then echo "Found! Using manual segmentation." - rsync -avzh $FILESEGMANUAL ${FILESEG}.nii.gz + sct_resample -i ${FILESEGMANUAL}.nii.gz -mm $interp -x nn -o ${FILESEGMANUAL}_r.nii.gz + rsync -avzh ${FILESEGMANUAL}.nii.gz ${FILESEG}.nii.gz sct_qc -i ${file}.nii.gz -s ${FILESEG}.nii.gz -p sct_deepseg_sc $qc else # Segment spinal cord From 0322ce67982d6b4530ecddd6b4245705162de996 Mon Sep 17 00:00:00 2001 From: PaulBautin <49245398+PaulBautin@users.noreply.github.com> Date: Fri, 16 Oct 2020 19:18:04 -0400 Subject: [PATCH 3/8] update config_sct_run_batch for compute canada --- config_sct_run_batch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_sct_run_batch.yml b/config_sct_run_batch.yml index 756a997..093bbdd 100644 --- a/config_sct_run_batch.yml +++ b/config_sct_run_batch.yml @@ -1,6 +1,6 @@ # config file for sct_run_batch path_data: /scratch/pabaua/data-multi-subject-p -path_output: /scratch/pabaua/results_csa_t2_2 +path_output: /scratch/pabaua/results_csa_t2_3 script: /home/pabaua/csa-atrophy/process_data.sh script_args: /home/pabaua/csa-atrophy/config_script_t2.yml jobs: -1 From 482a70471cab25bc344959e6343175b1fdbc5066 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 9 Nov 2020 23:54:47 -0500 Subject: [PATCH 4/8] - pull from master - update file name resample --- process_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_data.sh b/process_data.sh index a15d38e..ea88915 100755 --- a/process_data.sh +++ b/process_data.sh @@ -82,7 +82,7 @@ segment_if_does_not_exist(){ if [ -e $FILESEGMANUAL ]; then echo "Found! Using manual segmentation." sct_resample -i ${FILESEGMANUAL}.nii.gz -mm $interp -x nn -o ${FILESEGMANUAL}_r.nii.gz - rsync -avzh ${FILESEGMANUAL}.nii.gz ${FILESEG}.nii.gz + rsync -avzh ${FILESEGMANUAL}_r.nii.gz ${FILESEG}.nii.gz sct_qc -i ${file}.nii.gz -s ${FILESEG}.nii.gz -p sct_deepseg_sc $qc else # Segment spinal cord From e260200c2b5e30497d0de0ed18f13dae1e257f33 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 9 Nov 2020 23:58:51 -0500 Subject: [PATCH 5/8] - remove local config --- config_sct_run_batch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_sct_run_batch.yml b/config_sct_run_batch.yml index 093bbdd..94699c5 100644 --- a/config_sct_run_batch.yml +++ b/config_sct_run_batch.yml @@ -1,6 +1,6 @@ # config file for sct_run_batch path_data: /scratch/pabaua/data-multi-subject-p -path_output: /scratch/pabaua/results_csa_t2_3 +path_output: /scratch/pabaua/results_csa_t2 script: /home/pabaua/csa-atrophy/process_data.sh script_args: /home/pabaua/csa-atrophy/config_script_t2.yml jobs: -1 From 6104cf5d9dd5b31b779ae55439d9ec5cb03861c7 Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 14 Nov 2020 20:33:46 -0500 Subject: [PATCH 6/8] - rename config_script_t2.yml config_script.yml - put interp in config_script.yml --- config_script_t2.yml => config_script.yml | 4 ++++ process_data.sh | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) rename config_script_t2.yml => config_script.yml (82%) diff --git a/config_script_t2.yml b/config_script.yml similarity index 82% rename from config_script_t2.yml rename to config_script.yml index 983fb59..ccedede 100644 --- a/config_script_t2.yml +++ b/config_script.yml @@ -14,8 +14,12 @@ rescaling: - 0.95 - 0.94 - 0.93 + # Contrasts on which to perform the analysis. Available values are: 't1', 't2' contrast: "t2" +# image resolution (generally T1w images have resolution 1mm isotropic and T2w images 0.8mm isotropic) +interp_t1: "1x1x1" +interp_t2: "0.8x0.8x0.8" # csa_atrophy_stat.py # ------------------- diff --git a/process_data.sh b/process_data.sh index ea88915..2c49554 100755 --- a/process_data.sh +++ b/process_data.sh @@ -37,6 +37,8 @@ n_transfo=$(yaml_parser -o n_transfo -i $config_script) rescaling=$(yaml_parser -o rescaling -i $config_script) R_COEFS=$(echo $rescaling | tr '[]' ' ' | tr ',' ' ' | tr "'" ' ') contrast=$(yaml_parser -o contrast -i $config_script) +interp_t1=$(yaml_parser -o interp_t1 -i $config_script) +interp_t2=$(yaml_parser -o interp_t2 -i $config_script) # FUNCTIONS # ============================================================================== @@ -112,12 +114,12 @@ rm -r dwi #======================================================================= cd anat # Reorient to RPI and resample file -if [ $contrast == "t2" ]; then - contrast_str="T2w" - interp="1x1x1" -elif [ $contrast == "t1" ]; then +if [ $contrast == "t1" ]; then contrast_str="T1w" - interp="1x1x1" + interp=$interp_t1 +elif [ $contrast == "t2" ]; then + contrast_str="T2w" + interp=$interp_t2 fi file=${SUBJECT}_${contrast_str} # Reorient image to RPI From 1c3c906b9d536699a333dd58733d90cf1ec7fcea Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 14 Nov 2020 20:34:14 -0500 Subject: [PATCH 7/8] - update config_sct_run_batch.yml --- config_sct_run_batch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_sct_run_batch.yml b/config_sct_run_batch.yml index 94699c5..f0968be 100644 --- a/config_sct_run_batch.yml +++ b/config_sct_run_batch.yml @@ -2,7 +2,7 @@ path_data: /scratch/pabaua/data-multi-subject-p path_output: /scratch/pabaua/results_csa_t2 script: /home/pabaua/csa-atrophy/process_data.sh -script_args: /home/pabaua/csa-atrophy/config_script_t2.yml +script_args: /home/pabaua/csa-atrophy/config_script.yml jobs: -1 batch_log: sct_run_batch_log.txt continue_on_error: 1 From bb4e11f4fc40c135e8fea5b2f59ac9a46472d485 Mon Sep 17 00:00:00 2001 From: PaulBautin <49245398+PaulBautin@users.noreply.github.com> Date: Sun, 15 Nov 2020 10:27:39 -0500 Subject: [PATCH 8/8] Improve config_script.yml comments Co-authored-by: Julien Cohen-Adad --- config_script.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_script.yml b/config_script.yml index ccedede..a607389 100644 --- a/config_script.yml +++ b/config_script.yml @@ -17,7 +17,7 @@ rescaling: # Contrasts on which to perform the analysis. Available values are: 't1', 't2' contrast: "t2" -# image resolution (generally T1w images have resolution 1mm isotropic and T2w images 0.8mm isotropic) +# Resampling resolution in mm. Native resolutions for the spine-generic project are 1mm isotropic for T1w images and 0.8mm isotropic for T2w images. interp_t1: "1x1x1" interp_t2: "0.8x0.8x0.8"