-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update T1w scans with re-defaced images #146
Comments
Thank you @renelabounek!
|
In the most of the images in bids format, I have executed fslreorient2std. But not in all the cases. Thus, it may be worth to double check if orientation of all updated scans is the same as manually drawn masks, etc. in the database. |
Thanks for this comment! This is important information! I checked the orientation of both the original images (located under master branch) and the re-defaced ones ( # orig
data-multi-subject-redefaced$ for file in sub-*/anat/*nii.gz;do echo ${file}; sct_image -i ../data-multi-subject/${file} -header | grep -E qform_[xyz];echo "";done >> orientations_orig.txt
# re-defaced
data-multi-subject-redefaced$ for file in sub-*/anat/*nii.gz;do echo ${file}; sct_image -i ${file} -header | grep -E qform_[xyz];echo "";done >> orientations_redefaced.txt orientations_orig.txt Indeed, in 18 subjects, orientation has been changed from LPI to RPI; see here.
Good point! The thing is that the label files under A possible solution: reorient the re-defaced images back to LPI using |
We agreed on this solution during the SCT dev meeting on 2023-08-10 --> I will do it. |
I fixed the orientation using the following script:#!/bin/bash
# Fix orientation of the re-defaced images to match the original images
for file in sub-*/anat/*nii.gz;do
redefaced_image=${file}
original_image="../data-multi-subject/${file}"
echo "Redefaced image: ${redefaced_image}"
echo "Original image: ${original_image}"
# Fetch orientations, e.g., LPI or RPI
redefaced_orientation=$(sct_image -i ${redefaced_image} -header | grep -E qform_[xyz] | awk '{printf "%s", substr($2, 1, 1)}')
original_orientation=$(sct_image -i ${original_image} -header | grep -E qform_[xyz] | awk '{printf "%s", substr($2, 1, 1)}')
echo "Redefaced orientation: ${redefaced_orientation}"
echo "Original orientation: ${original_orientation}"
if [[ ${redefaced_orientation} != ${original_orientation} ]]; then
echo "Orientations are different --> fixing it"
sct_image -i ${redefaced_image} -setorient ${original_orientation} -o ${redefaced_image}
fixed_orientation=$(sct_image -i ${redefaced_image} -header | grep -E qform_[xyz] | awk '{printf "%s", substr($2, 1, 1)}')
echo "Fixed orientation: ${fixed_orientation}"
fi
done Now, the orientation between the re-defaced and original images (located under master branch) is identical: orientations_orig.txt See diff here. I saved the data to |
Following the #115, I have shared with @jcohenadad 49 re-defaced T1w scans. I have done visual inspection and confirm that no subject ID switch happenned and that re-defaced scans contains the whole brain volume without any cut-offs.
Six scans can not be re-defaced, because raw data are unavailable:
We should decide if bain cut offs are minimal in these 6 scans or if these IDs should be added into the brain_t1 category in the exclude.yml file.
I am still awaiting if another 4 scans of one center will be re-defaced or not.
The text was updated successfully, but these errors were encountered: