Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resample images to desired resolution #85

Merged
merged 9 commits into from
Nov 15, 2020
2 changes: 1 addition & 1 deletion config_sct_run_batch.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

why these changes? they are local (ie specific to your config)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is to keep track of the configs i used when i run jobs on compute canada. I will not merge this into master. In the future i will fork the repo for these kinds of PRs.

script: /home/pabaua/csa-atrophy/process_data.sh
script_args: /home/pabaua/csa-atrophy/config_script_t2.yml
jobs: -1
Expand Down
7 changes: 4 additions & 3 deletions process_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

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

problem here, the resampled ${FILESEGMANUAL}_r.nii.gz should be copied to ${FILESEG}.nii.gz

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggestion was implemented in commit: 482a704

sct_qc -i ${file}.nii.gz -s ${FILESEG}.nii.gz -p sct_deepseg_sc $qc
else
# Segment spinal cord
Expand Down Expand Up @@ -117,7 +118,7 @@ cd anat
# Reorient to RPI and resample file
if [ $contrast == "t2" ]; then
contrast_str="T2w"
interp="0.8x0.8x0.8"
interp="1x1x1"
Copy link
Member

Choose a reason for hiding this comment

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

i was suggesting to resample to 1mm iso only for "checking" the effect of this resampling, not for the "stable" release of the pipeline

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for the confusion, i was thinking of re-running this PR on Compute Canada to put results in the article's supplementary material (It could partly explain differences observed between t1 and t2 results). @jcohenadad, what are your thoughts on that?

Copy link
Member

Choose a reason for hiding this comment

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

sounds good. IN fact, if we explore the effect of resampling, we probably want to also try other resamplings, e.g. 1.2mm iso

elif [ $contrast == "t1" ]; then
contrast_str="T1w"
interp="1x1x1"
Expand Down