I have a rather specific issue that I’m hoping to get some input on. I got some helpful feedback on Twitter, but Chris (effigies) suggested I post here for a more formal back-and-forth.
I am planning to use fmriprep to analyze a very large existing dataset (Cam-CAN, for those who are familiar). After requesting access, you are granted a server login and can download the data from ~700 participants. Importantly, you get NIFTIs, but not the raw DICOMs.
I had to rework their file directory structure a bit to make it fully BIDS-compatible, but this is what I did (notably, each subject has JSON files in the same directory as the corresponding NIFTI files, but I didn’t see a need to make master JSON files in the parent directory):
CamCan/ dataset_description.json participants.tsv each participant folder/ anat/ t1w NIFTIs & JSONs t2w NIFTIs & JSONs fmap/ phasediff NIFTIs & JSONs magnitude 1 NIFTIs (no JSONs) magnitude 2 NIFTIs (no JSONs) func/ rest NIFTIs & JSONs movie NIFTIs & JSONs (BOLD during film viewing)
When running the BIDS Validator, I get the following errors:
Repetition time did not match between the scan’s header and the associated JSON metadata file.1246 files
sub-CC110045_task-Movie_bold.nii.gz27256.459 KB | application/x-gzip
Repetition time defined in the JSON (2.47 sec.) did not match the one defined in the NIFTI header (0 sec.)
sub-CC110045_task-Rest_bold.nii.gz36890.833 KB | application/x-gzip
Repetition time defined in the JSON (1.97 sec.) did not match the one defined in the NIFTI header (0 sec.)
The TRs being read out from the JSON file (2.47 for movie, 1.97 for rest) are indeed the desired values, but it’s seemingly reading out TR=0 from the NIFTI header. To further complicate matters, this isn’t what the NIFTI header appears to actually contain, if one runs fslhd on a given file, the TR appears to be 1sec (bolded):
qform_name Aligned Anat
qto_xyz:1 -2.993574 0.000000 -0.290462 95.590027
qto_xyz:2 0.103233 2.551443 -2.330460 -50.001572
qto_xyz:3 -0.166914 1.578015 3.768048 -120.494217
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_name Aligned Anat
sto_xyz:1 -2.993574 0.000000 -0.290466 95.590027
sto_xyz:2 0.103233 2.551443 -2.330460 -50.001572
sto_xyz:3 -0.166917 1.578015 3.768048 -120.494217
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
descrip 4D image
To confirm this using another tool, running AFNI’s 3dinfo on that same file indicates “Time step = 1.00000s”.
So I have two issues. (1) My NIFTI headers do not contain the proper TR values. Unfortunately, the root of the problem is beyond my control since the data aren’t mine and I’m having to start from these NIFTIs, so I likely need to manually edit the headers. Any input on the optimal way to go about this would be greatly appreciated. (2) The BIDS Validator is nonetheless failing to capture the erroneous TR=1 in the NIFTI header, instead finding TR=0. Thus, I’m concerned that even if I fix the TR values in the NIFTI headers, the BIDS validator (and therefore fmriprep) will probably fail anyway. Should I be concerned with these NIFTIs beyond the TR situation? (If so, that might be a problem of broad interest since a number of publications have been released based on this very dataset…)
Thanks very much in advance.