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

Some subjects have different image and label dimensions and resolution #144

Closed
valosekj opened this issue Apr 28, 2023 · 2 comments · Fixed by #159
Closed

Some subjects have different image and label dimensions and resolution #144

valosekj opened this issue Apr 28, 2023 · 2 comments · Fixed by #159
Assignees

Comments

@valosekj
Copy link
Contributor

valosekj commented Apr 28, 2023

Some subjects have different image and label dimensions and resolution.

For example, for subject sub-beijingGE02, T2w image has different dim and pixdim than T2w spinal cord segmentation:

$ sct_image -i sub-beijingGE02/anat/sub-beijingGE02_T2w.nii.gz -header | grep dim | head -2
dim		[3, 56, 256, 256, 1, 1, 1, 1]
pixdim		[1.0, 0.8, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0]

$ sct_image -i derivatives/labels/sub-beijingGE02/anat/sub-beijingGE02_T2w_seg-manual.nii.gz -header | grep dim | head -2
dim		[3, 56, 320, 320, 1, 1, 1, 1]
pixdim		[-1.0, 0.799994, 0.8, 0.8, 1.0, 1.0, 1.0, 1.0]

This discrepancy probably originates from processing, where T2w image was resampled and then segmented:

# T2
# ------------------------------------------------------------------------------
file_t2="${SUBJECT}_T2w"
# Reorient to RPI and resample to 0.8mm iso (supposed to be the effective resolution)
sct_image -i ${file_t2}.nii.gz -setorient RPI -o ${file_t2}_RPI.nii.gz
sct_resample -i ${file_t2}_RPI.nii.gz -mm 0.8x0.8x0.8 -o ${file_t2}_RPI_r.nii.gz
file_t2="${file_t2}_RPI_r"
# Segment spinal cord (only if it does not exist)
segment_if_does_not_exist $file_t2 "t2"

In other words, data-multi-subject contains the original non-resampled T2w image but SC seg obtained from resampled T2w image.
So far, I noticed this for sub-beijingGE and sub-brnoUhb subjects.

@jcohenadad
Copy link
Member

This discrepancy probably originates from processing, where T2w image was resampled and then segmented:

Yup! This is exactly it. Thank you for catching that @valosekj 🙏

Not sure what is the best course of action from there... I guess it depends how these manual labels are used.

@valosekj
Copy link
Contributor Author

valosekj commented May 2, 2023

Not sure what is the best course of action from there... I guess it depends on how these manual labels are used.

Right, it really depends on the processing steps which are run. I noticed this because I was using "raw" T2w images without applying the resampling. If resampling is applied, everything is fine.

Perhaps we could add the following paragraph to the README.md file (as we did for canproco) to inform future users:

## Derivatives
Note: T1w and T2w images were preprocessed prior to spinal cord segmentation and disc labeling.
Namely, reorientation to RPI and resampling to 1mm (T1w) and 0.8mm (T2w) isotropic voxel size was performed. 
Therefore, for some subjects, the original T1w and T2w images have different dimensions than the segmentation and disc labeling.
Applied preprocessing steps for T1w image:
https:/spine-generic/spine-generic/blob/master/process_data.sh#L146-L157
Applied preprocessing steps for T2w image:
https:/spine-generic/spine-generic/blob/master/process_data.sh#L175-L183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants