bids-standard / bids-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/bids-validator/
MIT License
185 stars 111 forks source link

support for Bids Extension Proposals (BEP) #439

Closed sappelhoff closed 6 years ago

sappelhoff commented 6 years ago

Is there a general time line of what needs to happen until a BEP (e.g., BEP_006 for EEG) will be supported by the bids-validator?

Will the BEP only ever be supported once a paper has been out (like for BEP_008 for MEG) and the BEP has been merged with the overall BIDS specification?

If yes, this could be an issue for people who want to upload their data to openneuro, where a successful BIDS check (I assume that the /INFC/bids-validator is used for checking at openneuro) seems to be a prerequisite.

chrisgorgo commented 6 years ago

The procedure is usually the following,

  1. BEP gets written among experts - reaches maturity.
  2. Example datasets are being added to BIDS-examples to a dedicated branch (bepxxx)
  3. A PR is opened to the bids-validator.
  4. A public call for comments is announced.
  5. (optional) Paper about the BEP is being written and submitted.
  6. (optional) Reviewers comments are incorporated in the BEP
  7. Deadline for comments is announced.
  8. BEP is frozen and merged into the main document.
  9. bepxxx BIDS-examples branch is merged into master
  10. validator PR is merged and new version is released

As for OpenNeuro you can use .bidsignore file to upload datasets with not yet supported files.

sappelhoff commented 6 years ago

Hi @chrisfilo, thanks for the detailed overview of the process!

Concerning the solution using a .bidsignore for OpenNeuro, the validator yields an error, when it does not find at least one "available modality":

Quick validation failed - the general folder structure does not resemble a BIDS dataset. Have you chosen the right folder (with "sub-*/" subfolders)? Check for structural/naming issues and presence of at least one subject.

So having a dataset with e.g., only /eeg modalities seems to be not possible (am I going wrong somewhere?). The validator works OK and does not yield the same error as soon as I additionally create e.g., /func/sub-xxx_task-xxx_bold.nii.gz within my EEG BIDS directory. The result then is, that /eeg is not recognized as a modality and I only get the error, that my files are not readable (which is to be expected as they are empty)

For reference, this is the code I used to test with standard BIDS structures:

import os

def mk_BIDS(path='./BIDS_test', subjs=10, data_type='bold'):
    """Make a BIDS directory."""
    # select data to prepare
    if data_type == 'eeg':
        f_ending = '.eeg'
        data_dir_name = 'eeg'
    elif data_type == 'bold':
        f_ending = '.nii.gz'
        data_dir_name = 'func'

    # Make the test dir
    os.makedirs(path)

    # Make the standard files
    fnames = ['task-testtask_' + data_type + '.json',
              'dataset_description.json',
              'participants.tsv',
              'CHANGES',
              'README',
              '.bidsignore'
              ]
    for f in fnames:
        open(os.path.join(path, f), 'a').close()

    # Make participant specific files
    leading_zeros = len(str(subjs))
    for sub in range(1, subjs+1):
        id_str = 'sub-' + str(sub).zfill(leading_zeros)

        # Make data directories
        p = os.path.join(path, id_str, data_dir_name)
        os.makedirs(p)

        # Make fake data files
        fname = id_str + '_task-testtask_' + data_type + f_ending
        fpath = os.path.join(p, fname)
        open(fpath, 'a').close()

        # Make fake event files
        fname = id_str + '_task-testtask_events.tsv'
        fpath = os.path.join(p, fname)
        open(fpath, 'a').close()

if __name__ == '__main__':
    mk_BIDS(path='./BIDS_test_bold', subjs=10, data_type='bold')
    mk_BIDS(path='./BIDS_test_eeg', subjs=10, data_type='eeg')
chrisgorgo commented 6 years ago

I see. This is expected. I'm not sure if it would be wise to disable this check in the validator.