nipreps / smriprep

Structural MRI PREProcessing (sMRIPrep) workflows for NIPreps (NeuroImaging PREProcessing tools)
https://nipreps.github.io/smriprep
Apache License 2.0
133 stars 39 forks source link

Rename anatomical outputs to conform to BIDS Derivatives RC1 #6

Closed effigies closed 5 years ago

effigies commented 6 years ago

This is my interpretation of RC1. If it's incorrect, we may want to clarify the text.

@oesteban @satra @edickie Can you verify the transforms (bottom) and space- usage? @ahoopes @edickie Can you verify the probseg/dseg/surfaces?

Filenames

Using examples from ds114/sub-07/anat:

Old New
sub-07_T1w_preproc.nii.gz
  • [x] sub-07_desc-preproc_T1w.nii.gz
sub-07_T1w_brainmask.nii.gz
  • [x] sub-07_desc-brain_mask.nii.gz
sub-07_T1w_class-{CSF\|GM\|WM}_probtissue.nii.gz
  • [x] sub-07_label-{CSF\|GM\|WM}_probseg.nii.gz
sub-07_T1w_dtissue.nii.gz
  • [x] sub-07_dseg.nii.gz
sub-07_T1w_[surftype].{L\|R}.surf.gii
  • [x] sub-07_hemi-{L\|R}_[surftype].surf.gii
sub-07_T1w_label-aparcaseg_roi.nii.gz
  • [x] sub-07_desc-aparcaseg_dseg.nii.gz
sub-07_T1w_label-aseg_roi.nii.gz
  • [x] sub-07_desc-aseg_dseg.nii.gz
sub-07_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz
  • [x] sub-07_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz
... ...
sub-07_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5
  • [x] sub-07_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
sub-07_T1w_target-fsnative_affine.txt
  • [x] sub-07_from-T1w_to-fsnative_mode-image_xfm.txt
sub-07_T1w_target-MNI152NLin2009cAsym_warp.h5
  • [x] sub-07_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5

Additionally, we have multiple T1w images, so we have the following per-session files:

Old New
sub-07_ses-<session>_T1w_space-orig_target-T1w_affine.txt
  • [ ] sub-07_ses-<session>_from-orig_to-T1w_mode-image_xfm.txt

Metadata

edickie commented 6 years ago

Thanks for getting started on this Chris! Most of it looks right to me.

I am also a little confused about how we are going to handle the "apacaseg" files as well. I remember Andrew saying that the freesurfer lookup table works for both aseg and aparcaseg, so only one labels.tsv would be needed.

Andrew: does the freesurfer table also follow the same labels convention are the BIDS standard dseg tissue classification? So only one dseg_labels.tsv is needed? or do we need multiple?

Thanks, Erin

On Wed, Oct 3, 2018 at 12:23 PM Chris Markiewicz notifications@github.com wrote:

This is my interpretation of RC1. If it's incorrect, we may want to clarify the text.

@oesteban https://github.com/oesteban @satra https://github.com/satra @edickie https://github.com/edickie Can you verify the transforms (bottom) and space- usage? @ahoopes https://github.com/ahoopes @edickie https://github.com/edickie Can you verify the probseg/dseg/surfaces? Filenames

Using examples from ds114/sub-07/anat: Old New sub-07_T1w_preproc.nii.gz sub-07_desc-preproc_T1w.nii.gz sub-07_T1w_brainmask.nii.gz sub-07_desc-brain_mask.nii.gz sub-07_T1w_class-{CSF|GM|WM}_probtissue.nii.gz sub-07_label-{CSF|GM|WM}_probseg.nii.gz sub-07_T1w_dtissue.nii.gz sub-07_dseg.nii.gz sub-07T1w[surftype].{L|R}.surf.gii sub-07hemi-{L|R}[surftype].surf.gii sub-07_T1w_label-aparcaseg_roi.nii.gz sub-07_desc-aparcaseg_dseg.nii.gz sub-07_T1w_label-aseg_roi.nii.gz sub-07_desc-aseg_dseg.nii.gz sub-07_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz sub-07_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz ... ... sub-07_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 sub-07_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 sub-07_T1w_target-fsnative_affine.txt sub-07_from-T1w_to-fsnative_mode-image_xfm.txt sub-07_T1w_target-MNI152NLin2009cAsym_warp.h5 sub-07_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5

Additionally, we have multiple T1w images, so we have the following per-session files: Old New sub-07_ses-_T1w_space-orig_target-T1w_affine.txt sub-07_ses-_from-orig_to-T1w_mode-image_xfm.txt Metadata

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/poldracklab/fmriprep/issues/1302, or mute the thread https://github.com/notifications/unsubscribe-auth/AMl59iXvXzxKXmfrLPuVdQRhQKsJWl5tks5uhORxgaJpZM4XGZAo .

ahoopes commented 6 years ago

Looks good to me as well!

And yes, the standard freesurfer lookup table is used for both aseg.mgz and aparc+aseg.mgz. Though, it does not match the labels in the standard BIDs tissue table.

I was thinking that any label specified in a labels.tsv file (whether top-level or sidecar) would have priority over a clashing definition in the standard BIDs lookup table. So, for the case of freesurfer derivatives, a top-level labels.tsv would just mimic FreeSurferColorLUT.txt and would automatically propagate to sub-1_desc-aparcaseg_dseg.nii.gz and sub-1_desc-aseg_dseg.nii.gz.

oesteban commented 6 years ago

Thanks a lot @ahoopes! Would it be too much to ask you a top-level labels.tsv file adapting FreeSurferColorLUT.txt to BIDS so that any user can just fetch it?

ahoopes commented 6 years ago

sure thing - the freesurfer labels.tsv can be downloaded from: https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/misc/labels.tsv

I'm in the process of adding a recon-all flag called --bids that will automatically create $SUBJECTS_DIR/labels.tsv from $FREESURFER_HOME/FreeSurferColorLUT.txt and convert commonly-used freesurfer output to BIDS-formatted filenames.

oesteban commented 6 years ago

Sweet, thanks!!

colinlaney commented 5 years ago

I'm sorry, what is xfm? Looks like FLIRT parameter, but doesn't make sense.

effigies commented 5 years ago

Transform.

colinlaney commented 5 years ago

Sure, but what kind of? I meant it was obviously: affine is linear transform, warp is non-linear transform. But xfm is not self-descriptive and it misleads to which transform we deal with. Only the file format suggests the type of transform now.

effigies commented 5 years ago

This is what is currently specified by the BIDS draft specification. See https://docs.google.com/document/d/17ebopupQxuRwp7U7TFvS6BH03ALJOgGHufxK8ToAvyI/edit#heading=h.rxc844jqesod

It does not appear to have made it into bids-standard/bids-specification#109, but it is currently what we have to work with.

colinlaney commented 5 years ago

Thank you, I have missed this update of BIDS.

oesteban commented 5 years ago

@ahoopes https://github.com/templateflow/tpl-fsaverage/blob/master/tpl-fsaverage_dseg.tsv - thanks!