bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

Quick validation check only looks at JSON, TSV, NII -- but should look at directory structure

Open Remi-Gau opened this issue 5 years ago • 12 comments

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.

Remi-Gau avatar Sep 04 '19 15:09 Remi-Gau

@sappelhoff It looks like you figured out the issue previously. Any insights?

effigies avatar Sep 04 '19 16:09 effigies

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

sappelhoff avatar Sep 04 '19 17:09 sappelhoff

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?

Remi-Gau avatar Sep 04 '19 20:09 Remi-Gau

The online one should always be the latest.

effigies avatar Sep 04 '19 20:09 effigies

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:

sappelhoff avatar Sep 05 '19 09:09 sappelhoff

Perhaps .bdf is not being handled correctly?

effigies avatar Sep 05 '19 13:09 effigies

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.

rwblair avatar Jun 25 '20 23:06 rwblair

#557 is loosely related, if we had path regex we'd probably use it here.

rwblair avatar Jun 25 '20 23:06 rwblair

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 .

VisLab avatar Jun 25 '20 23:06 VisLab

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 !

sappelhoff avatar Jun 26 '20 06:06 sappelhoff

We have determined that this issue is not related to #967 after all. I do not currently have plans to tackle this issue.

happy5214 avatar Aug 02 '20 18:08 happy5214

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

sappelhoff avatar Aug 03 '20 07:08 sappelhoff