yjmantilla / sovabids

A python package for the automatic conversion of EEG datasets to the BIDS standard, with a focus on making the most out of metadata.
https://sovabids.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Designing of the "Translation Rules" File #6

Closed yjmantilla closed 3 years ago

yjmantilla commented 3 years ago

The "Translation Rules" file is the output of the "DISCOVER RULES" module, which is the one with the heuristics to infer metadata, so this file just is:

the way we represent the rules to infer the metadata

This file should be plain text and human-readable to allow power-user edits.

So what I have thought so far that should be in this file:

To Do

When the characterization of the fields is done I'm sure we will have more clarity to complete the other task and to even propose more necessary ones.

yjmantilla commented 3 years ago

Oren's proposal

For historical reasons I leave here what @civier initially suggested:

Configuration file format

The file is made of 3 columns:

Of course that the location of files (and location within files) in the BIDS might depend on values in the raw data as well. In that case, also the 2nd column can include $1, $2, etc.

A similar table should also be used in order to indicate where the data files in the raw MEEG format should be copied to, but that is of course simpler, as we assume the files do not need to be combined or altered.

The above is only my suggestion, of course. The notation of the configuration file can be made more efficient (by including global variables) or more sophisticated, as you wish. The important thing is to make it only as sophisticated as necessary. We don’t want to build a universal configuration file, but only one that will serve for MEEG-to-BIDS conversions.

Configuration file format

Example of one row in the table:

Origin location Target location Formula
subject1/eeg/session4/config.csv/1/8 subject1/eeg/session4/config.csv/1/9 eeg/eeg_rest_raw/sub-1/ses-rest-ses4/eeg/sub-1_ses-rest_coordsystem.json/“Coordinates”/“NAS”/2 ${1} + ${2}

General configuration file format

Example of one row in the table:

Origin location Target location Formula
subject1/eeg/session${A}/config.csv/1/8 subject1/eeg/session${A}/config.csv/1/9 eeg/eeg_rest_raw/sub-1/ses-rest-ses${A}/eeg/sub-1_ses-rest_coordsystem.json/“Coordinates”/“NAS”/2 ${1} + ${2}

The "Translation Rules" is similar as what @civier imagined as the "General Configuration file".

yjmantilla commented 3 years ago

So, as of now Im thinking yaml > json since:

yjmantilla commented 3 years ago

A validator of the rules file would be nice to implement, so as to assert it is in the correct format.

yjmantilla commented 3 years ago

Closing this, it is done