-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BF: fix repetition time in PARREC header #692
Conversation
Please merge master to fix style checks. |
fc4467c
to
f29154a
Compare
Codecov Report
@@ Coverage Diff @@
## master #692 +/- ##
==========================================
- Coverage 89.55% 88.88% -0.67%
==========================================
Files 93 93
Lines 11474 11449 -25
Branches 1992 1892 -100
==========================================
- Hits 10275 10176 -99
- Misses 859 933 +74
Partials 340 340
Continue to review full report at Codecov.
|
@effigies Sure! I rebased my pr on master |
Thanks. Just out of curiosity, why use milliseconds over seconds? Simply to transparently report the values in the file, or was there some other bug? I ask because a lot of code assumes that |
My attention was drawn to this after hearing the reason why my colleagues are using dcm2niix over Nibabel's parrec2nii; the BIDS tools they use to read Nifti's (like fmriprep) expect the value to be in milliseconds and do not accept the files produced by parrec2nii. Also, it seems a lot cleaner to transparently report the value in the value. |
fMRIPrep was not written to expect TRs to be in milliseconds, and in fact ignores the NIfTI file TRs altogether, preferring the Is it possible that nibabel is outputting NIfTIs with TRs in seconds but reporting millisecond units? That could cause problems. |
JSON sidecarts are not required for fMRIPrep to run right? That would explain these problems indeed, but is there a field in the NifTI header that sets the units for the Tr? |
fMRIPrep assumes a valid BIDS dataset. While not all mandatory metadata is accessed, we do attempt to access some of it, including The xyzt_units field of the NIfTI header can includes the bitwise AND of spatial and temporal units, with codes described here: Lines 130 to 141 in ad26878
A code of 10 indicates spatial units of To quickly view the shape and units of a file you have (if nibabel is installed):
|
Hi @Roosted7, just checking in on what your thoughts are on this? Are you still having issues with some software expecting milliseconds? Could you provide a test where a file is written with bad metadata? |
I'm not sure if this is fixed yet, but I'm also having this issue. The TR number is being converted to sec, but the time scale is still in msec. When I run |
@epongpipat Sorry about the extreme delay, but thanks for your comment. I had a poke around Lines 766 to 780 in 7a7a913
This reports |
Closing for now. |
While I was working on #683, I noticed that the scaling in the repetition time header field is wrong.
It looks like the last value of
get_zooms()
should report the repetition time in milliseconds and not in seconds.Ofcourse, I also fixed the tests.