bids-validator
bids-validator copied to clipboard
Quick validation check only looks at JSON, TSV, NII -- but should look at directory structure
EDIT: root of problem is described here: https://github.com/bids-standard/bids-validator/issues/830#issuecomment-649869429
Helping a friend create a her first EEG data set. Not sure about the following problem.
The 2 following options (A and B) are valid data sets according to the validator:
A)
├── dataset_description.json
├── sub-04
│ └── eeg
│ ├── sub-04_task-orth_eeg.bdf
│ └── sub-04_task-orth_eeg.json
├── sub-99
│ └── eeg
│ ├── sub-99_task-orth_eeg.bdf
│ └── sub-99_task-orth_eeg.json
└── task-orth_eeg.json
B) same but after removing the json file for subject 04
├── dataset_description.json
├── sub-04
│ └── eeg
│ └── sub-04_task-orth_eeg.bdf
├── sub-99
│ └── eeg
│ ├── sub-99_task-orth_eeg.bdf
│ └── sub-99_task-orth_eeg.json
└── task-orth_eeg.json
But the following is not.
C) After removing json files for both subject and using only the json file in the base directory.
├── dataset_description.json
├── sub-04
│ └── eeg
│ └── sub-04_task-orth_eeg.bdf
├── sub-99
│ └── eeg
│ └── sub-99_task-orth_eeg.bdf
└── task-orth_eeg.json
Validator says:
Quick validation failed - the general folder structure does not resemble a BIDS dataset.
Attached is the error file from the validator. YF_EEG_BIDS_errors.txt
Any idea what is going on? This seems related to #477.
@sappelhoff It looks like you figured out the issue previously. Any insights?
mhhh this is certainly a bug, and indeed one I encountered before (and I thought that I fixed it) ... so it's perhaps a regression. I don't know why this behavior is now re-occurring. What version of the validator are you using @Remi-Gau ?
cc @rwblair
This is from the online validator. I still have not moved to using something local... :-/ Should I try running the latest version of the repo locally to check?
The online one should always be the latest.
What's interesting is that the eeg_matchingpennies
example also makes use of the Inheritance Principle with the EEG JSON sidecar file, see: https://github.com/bids-standard/bids-examples/tree/master/eeg_matchingpennies
And this dataset passes the test :thinking:
Perhaps .bdf
is not being handled correctly?
Found the problem. The quick test looks at all files and sees if at least one of them will pass the isCorrectModality test: https://github.com/bids-standard/bids-validator/blob/master/bids-validator/utils/modalities.js#L43
This really only looks at .nii*, .json, and .tsv, files and they can only be valid if they are in a subdirectory whose path has one of the modalities names in it.
I'm thinking that maybe quick test should be rewritten to just look at directory structure (specifically do you have a subject directory and does it have a modality) and maybe to see is at least a file present. File extension mismatches are caught by the regex further on.
#557 is loosely related, if we had path regex we'd probably use it here.
This is also related to issue #967. We have looked at the code and have a fix which happy5214 will hopefully do a pull request on.
On Thu, Jun 25, 2020 at 6:40 PM Ross Blair [email protected] wrote:
#557 https://github.com/bids-standard/bids-validator/issues/557 is loosely related, if we had path regex we'd probably use it here.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bids-standard/bids-validator/issues/830#issuecomment-649869968, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJCJOTGXGPGZ7LK6WRKZRLRYPN7BANCNFSM4ITTMP2Q .
I'm thinking that maybe quick test should be rewritten to just look at directory structure
+1 @rwblair ... apparently that quick test is back from BIDS 1.0, when there was no other modality than MRI
This is also related to issue #967. We have looked at the code and have a fix which happy5214 will hopefully do a pull request on
that'd be very welcome @happy5214 and @VisLab !
We have determined that this issue is not related to #967 after all. I do not currently have plans to tackle this issue.
What @rwblair said in https://github.com/bids-standard/bids-validator/issues/830#issuecomment-649869429 is on point.
this is also related to https://github.com/bids-standard/bids-validator/issues/792 --> both could be solved in one go and it looks like a reasonably simple job, so I added it to "low hangig fruits" project