Can't pass BIDS validator

Error 1: [Code 1] NOT_INCLUDED
Error 2: [Code 64] SUBJECT_LABEL_IN_FILENAME_DOESNOT_MATCH_DIRECTORY
Error 3: [Code 65] SESSION_LABEL_IN_FILENAME_DOESNOT_MATCH_DIRECTORY
Error 4: [Code 67] NO_VALID_DATA_FOUND_FOR_SUBJECT

Hello,

I cannot pass the BIDS validator and cannot understand why. I tried different structures for hours, and nothing goes. I need to store iEEG data (macro-electrodes & micro-electrodes, with for each scale several sessions, and for each session several runs) as well as MRI data. So I have to create several subfolders to organize the files properly but could not find the right structure.

Here is the tree of my file for now (below)… Do you see what is wrong? Thank you so much.

PS: I Kept << stimuli >> and << mri-ses >> empty for now, voluntarily, I’ll see that later.

BIDS_data/
    dataset_description.json
    participants.json
    participants.tsv
    stimuli/
    sub-001/
        ses-eeg/
            eeg-macro/
                ses-01/
                    sub-001_ses-01_scans.tsv
                    eeg/
                        sub-001_ses-01_run-01_channels.tsv
                        sub-001_ses-01_run-01_eeg.edf
                        sub-001_ses-01_run-01_eeg.json
                        sub-001_ses-01_run-01_events.tsv
                ses-02/
                    sub-001_ses-02_scans.tsv
                    eeg/
                        sub-001_ses-02_run-01_channels.tsv
                        sub-001_ses-02_run-01_eeg.edf
                        sub-001_ses-02_run-01_eeg.json
                        sub-001_ses-02_run-01_events.tsv
            eeg-micro/
                ses-01/
                    sub-001_ses-01_scans.tsv
                    eeg/
                        sub-001_ses-01_run-01_channels.tsv
                        sub-001_ses-01_run-01_eeg.edf
                        sub-001_ses-01_run-01_eeg.json
                        sub-001_ses-01_run-02_channels.tsv
                        sub-001_ses-01_run-02_eeg.edf
                        sub-001_ses-01_run-02_eeg.json
                        sub-001_ses-01_run-03_channels.tsv
                        sub-001_ses-01_run-03_eeg.edf
                        sub-001_ses-01_run-03_eeg.json
                ses-02/
                    sub-001_ses-02_scans.tsv
                    eeg/
                        sub-001_ses-02_run-01_channels.tsv
                        sub-001_ses-02_run-01_eeg.edf
                        sub-001_ses-02_run-01_eeg.json
                        sub-001_ses-02_run-02_channels.tsv
                        sub-001_ses-02_run-02_eeg.edf
                        sub-001_ses-02_run-02_eeg.json
                        sub-001_ses-02_run-03_channels.tsv
                        sub-001_ses-02_run-03_eeg.edf
                        sub-001_ses-02_run-03_eeg.json
        ses-mri/
            anat preop/
            tep postop/
    sub-002/
        ses-eeg/
            eeg-macro/
                ses-01/
                    sub-001_ses-01_scans.tsv
                    eeg/
                        sub-001_ses-01_run-01_channels.tsv
                        sub-001_ses-01_run-01_eeg.edf
                        sub-001_ses-01_run-01_eeg.json
                        sub-001_ses-01_run-01_events.tsv
                ses-02/
                    sub-001_ses-02_scans.tsv
                    eeg/
                        sub-001_ses-02_run-01_channels.tsv
                        sub-001_ses-02_run-01_eeg.edf
                        sub-001_ses-02_run-01_eeg.json
                        sub-001_ses-02_run-01_events.tsv
            eeg-micro/
                ses-01/
                    sub-002_ses-01_scans.tsv
                    eeg/
                        sub-002_ses-01_run-01_channels.tsv
                        sub-002_ses-01_run-01_eeg.edf
                        sub-002_ses-01_run-01_eeg.json
                        sub-002_ses-01_run-02_channels.tsv
                        sub-002_ses-01_run-02_eeg.edf
                        sub-002_ses-01_run-02_eeg.json
                        sub-002_ses-01_run-03_channels.tsv
                        sub-002_ses-01_run-03_eeg.edf
                        sub-002_ses-01_run-03_eeg.json
                ses-02/
                    sub-002_ses-02_scans.tsv
                    eeg/
                        sub-002_ses-02_run-01_channels.tsv
                        sub-002_ses-02_run-01_eeg.edf
                        sub-002_ses-02_run-01_eeg.json
                        sub-002_ses-02_run-02_channels.tsv
                        sub-002_ses-02_run-02_eeg.edf
                        sub-002_ses-02_run-02_eeg.json
                        sub-002_ses-02_run-03_channels.tsv
                        sub-002_ses-02_run-03_eeg.edf
                        sub-002_ses-02_run-03_eeg.json
        ses-mri/
            anat preop/
            tep postop/

The “eeg-macro” and “eeg-micro” nesting that you apply seems odd to me. It looks like you apply arbitrary nesting beyond what’s “allowed” in the BIDS specification.

I recommend to rename your sessions to accommodate for that:

  • sub-001
    • ses-eegMacro01
      • …_scans.tsv
      • eeg
        • …_channels.tsv
    • ses-eegMacro02
    • ses-eegMicro01
    • ses-eegMicro02
1 Like

Thank you Sappelhoff, it works well :slight_smile:

I really thought a more beautiful / clean way to write it, but maybe not.

Have a good day and thanks again

1 Like