bids-validator
bids-validator copied to clipboard
Inconsistency in RepetitionTime between nifti header and json not detected
I just tested this on a manually converted dataset (and on the MoAE SPM dataset) by modifying the value in the json file and the validator did not detect it.
What it may detect is "inconsistencies" with the events.tsv like is this:
- Warning 2: [Code 85] SUSPICIOUSLY_LONG_EVENT_DESIGN
- Warning 2: [Code 86] SUSPICIOUSLY_SHORT_EVENT_DESIGN
depending if you give it RepetitionTime
that are either very small or very long.
I am pretty sure that the bids validator used to be able to do this (see #34) so I suspect this is a regression.
Can someone reproduce that bug?
Strange I was able to generate the code by modifying either the last value in an events file, or by making the TR in json file very big. Here's the code where the check is performed:
https://github.com/bids-standard/bids-validator/blob/39b71556ea0c9ead4618cf6f5669e7ea19b9b23f/bids-validator/validators/events/events.js#L75
The check is only performed if there are headers for the niftis, so using --ignoreNiftiHeaders will skip the check all together.
What were the values for RepetitionTime and the event onset that you looked at?
I think those warnings make sense (for certain values in the json) but I am more worried that the fact that no error is thrown when the repetition time in the json is different from that in the nifiti header
Sorry, I misread the original post.
Just downloaded that MoAEpilot dataset and received this error when I modified the TR in the task json:
1: [ERR] Repetition time did not match between the scan's header and the associated JSON metadata file. (code: 12 - REPETITION_TIME_MISMATCH)
./sub-01/func/sub-01_task-auditory_bold.nii
What value did you put for "RepetitionTime" in the "task-auditory_bold.json"? Were you testing any on particular version/branch of the validator? See if I can't recreate issue from there.
what the ????
tested on the command line (version 1.8.4 - not a specific branch just got the npm package) and online version of the validator.
Tried RepetitionTime values ranging from 2 to 200. Only get warnings. Never an error.
I downloaded and replicated on the web...
I downloaded and replicated on the web...
"computational reproducibility" also includes: "does the bug replicate?"
The NIfTI validation code is so deeply nested. I wouldn't be surprised if it's a misplaced curly brace. Still, we have a test for this case that's passing, so there must be some combination of bools that's triggering the wrong way.
Ah this may have been fixed in #1339
My brain is shot. I thought about that, but thought it happened long enough ago that it must be released.
I waffled on merging it because of the tests were failing for an unrelated reason. I'll cut a new release soon.
Thanks both for looking into this! :hugs: