nipreps / niworkflows

Common workflows for MRI (anatomical, functional, diffusion, etc)
https://www.nipreps.org/niworkflows
Apache License 2.0
87 stars 52 forks source link

Propagate TR from BIDS structure to NIfTI dims #515

Open oesteban opened 4 years ago

oesteban commented 4 years ago

Transfer from poldracklab/fmriprep#1093.

effigies commented 4 years ago

This may be obviated by running the BIDS validator first, which will error when the TR doesn't match RepetitionTime or RepetitionTime is missing.

oesteban commented 4 years ago

Not really, metadata can be lost (e.g., split and merge). Having this convenience tool will come handy. We're checking other things (units, dtype, xforms...).

effigies commented 4 years ago

I guess let's be explicit: You're saying that sometimes we find derivatives don't have pixdim4 set, but other times we do? What could it be conditional on, if not the presence of pixdim4 in the original files, which is checked by the validator? A test case would be useful.

I would also consider it problematic for splitting or merging interfaces to change or lose pixdim4. That would be a good thing to fix, as it's possible that somewhere between validation and sinking derivatives we'll have jobs that actually need the TR. We can pass the TR to some interfaces, but it is metadata that should be stored accurately in the header.