PennLINC / qsiprep

Preprocessing of diffusion MRI
http://qsiprep.readthedocs.io
BSD 3-Clause "New" or "Revised" License
141 stars 58 forks source link

Consistently label spaces in filenames #854

Closed tsalo closed 2 weeks ago

tsalo commented 3 weeks ago

Summary

Here's an example tree from one of the tests, reduced to just include the basics:

sub-PNC/
    anat/
        sub-PNC_desc-preproc_T1w.nii.gz
        sub-PNC_from-T1wNative_to-T1wACPC_mode-image_xfm.mat
        sub-PNC_from-T1wACPC_to-T1wNative_mode-image_xfm.mat
        sub-PNC_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
        sub-PNC_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
    dwi/
        sub-PNC_acq-realistic_space-T1w_desc-preproc_dwi.nii.gz
        sub-PNC_acq-realistic_space-T1w_dwiref.nii.gz

We have transforms from T1wNative to T1wACPC, but no images in either space. Instead, space-T1w is used as a standin for T1wACPC in the DWI data, and there's no space in the anatomical data. I think we should consistently think of having no space entity as being in space-orig or space-native. For example, if you have a T1w and a T2w, the sub-X_desc-preproc_T1w.nii.gz and sub-X_desc-preproc_T2w.nii.gz would be assumed not to be in the same space.

Here's what the updated tree might look like:

sub-PNC/
    anat/
        sub-PNC_desc-preproc_T1w.nii.gz  # T1w in the native/original T1w space
        sub-PNC_desc-preproc_T2w.nii.gz  # T2w in the native/original T2w space. NOT T1w space!
        sub-PNC_space-T1wACPC_desc-preproc_T1w.nii.gz
        sub-PNC_space-T1wACPC_desc-preproc_T2w.nii.gz
        sub-PNC_from-T1w_to-T1wACPC_mode-image_xfm.mat
        sub-PNC_from-T1wACPC_to-T1w_mode-image_xfm.mat
        sub-PNC_from-T1wACPC_to-MNI152NLin2009cAsym_mode-image_xfm.h5
        sub-PNC_from-MNI152NLin2009cAsym_to-T1wACPC_mode-image_xfm.h5
    dwi/
        sub-PNC_acq-realistic_space-T1wACPC_desc-preproc_dwi.nii.gz
        sub-PNC_acq-realistic_space-T1wACPC_dwiref.nii.gz
tsalo commented 3 weeks ago

Just to be clear, T1wACPC is a stand-in for whatever we choose in #853.

cookpa commented 2 weeks ago

I think we should consistently think of having no space entity as being in space-orig or space-native.

BIDS spec agrees:

The scanner coordinate system is implicit and assumed by default if the derivative filename does not define any space-

araikes commented 2 weeks ago

I agree that no space is inherently space-orig.