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
Merged

Resample images to desired resolution #85

merged 9 commits into from
Nov 15, 2020

Conversation

PaulBautin
Copy link
Collaborator

@PaulBautin PaulBautin commented Oct 16, 2020

It was noticed in issue #83 that the CSA of rescaled t1w images was often overestimated. This could be caused by an increasing partial volume effect with tissue outside of the CSF. However, overestimation is less visible in t2w images, this is possibly due to better image resolution (0.8x0.8x0.8mm instead of 1x1x1mm). By resampling the T2w data to 1mm at the very beginning, it would be possible to see if difference between t1w and t2w results is caused by difference of native resolution.

DONE:

  • Resample t2w images

FIX #91

@@ -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.

@jcohenadad jcohenadad changed the title Compute canada test: resample t2w images to 1x1x1mm Resample t2w images to 1x1x1mm Oct 19, 2020
process_data.sh Outdated
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

process_data.sh Outdated
@@ -113,7 +114,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

@PaulBautin
Copy link
Collaborator Author

I finally decided to implement issue #91 in this PR with commit 6104cf5. @jcohenadad, i have tested this PR on a couple subjects and it works well. Could you review before merge?

config_script.yml Outdated Show resolved Hide resolved
Co-authored-by: Julien Cohen-Adad <jcohen@polymtl.ca>
@PaulBautin PaulBautin changed the title Resample t2w images to 1x1x1mm Resample images to desired resolution Nov 15, 2020
@PaulBautin PaulBautin merged commit 1eb258e into master Nov 15, 2020
@PaulBautin
Copy link
Collaborator Author

Last commits allow user to resample images to desired resolution. This new parameter must be configured in config_script.yml before running program.

@PaulBautin PaulBautin deleted the t2w_resample branch November 15, 2020 15:48
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.

Add image resampling resolution in config file
2 participants