Subject straightening in preprocess_normalize.pystraighten_all_subjects() method requires either SC mask NIFTI file (*_label-SC_mask.nii.gz) or centerline NIFTI file (*_label-centerline.nii.gz) , lines 476 to 491.
Currently, the generate_centerline() method generates centerlines for every subject, whether they have a SC mask or not. However, this method does not save the centerline files in NIFTI format. Therefore, straighten_all_subjects() method throws an error for subjects that do not have a SC mask in NIFTI file.
Solution
1) If the subject does not have a SC mask NIFTI file (*_label-SC_mask.nii.gz), check if it has a centerline NIFTI file (*_label-centerline.nii.gz) and use that instead.
2) If the subject does not have a SC mask NIFTI file (*_label-SC_mask.nii.gz) or a centerline NIFTI file (*_label-centerline.nii.gz), generate subject centerline and save the centerline NIFTI file (*_label-centerline.nii.gz).
Code
Master branch,
preprocess_normalize.py
Issue
Subject straightening in
preprocess_normalize.py
straighten_all_subjects()
method requires either SC mask NIFTI file (*_label-SC_mask.nii.gz
) or centerline NIFTI file (*_label-centerline.nii.gz
) , lines 476 to 491.Currently, the
generate_centerline()
method generates centerlines for every subject, whether they have a SC mask or not. However, this method does not save the centerline files in NIFTI format. Therefore,straighten_all_subjects()
method throws an error for subjects that do not have a SC mask in NIFTI file.Solution
1) If the subject does not have a SC mask NIFTI file (
*_label-SC_mask.nii.gz
), check if it has a centerline NIFTI file (*_label-centerline.nii.gz
) and use that instead. 2) If the subject does not have a SC mask NIFTI file (*_label-SC_mask.nii.gz
) or a centerline NIFTI file (*_label-centerline.nii.gz
), generate subject centerline and save the centerline NIFTI file (*_label-centerline.nii.gz
).