WinawerLab / SampleData

Code related to the processing of the Winawer lab sample dataset
MIT License
0 stars 2 forks source link

Physio json files not BIDS compliant #7

Open pvelasco opened 3 years ago

pvelasco commented 3 years ago

Currently, the *_physio.json files are not BIDS compliant.

According to the latest stable BIDS spec, the fields SamplingFrequency and StartTime refer to "all columns in the file".

Currently, the contents of the json file is a list of dictionaries, with each one of them having a SamplingFrequency and StartTime (which are the same for all elements of the list). Similarly, the FileFormat and RecordedEye are the same for all elements.

For these files to be BIDS compliant, they should contain a single dictionary with fields SamplingFrequency, StartTime with a single value; and a Columns field with a list of the column names. E.g., for sub-wlsubj042_ses-01_task-sfp_run-02_physio.json:

{
   "SamplingFrequency": 1000,
   "StartTime": 3852115,
   "Columns": ['time', 'x', 'y', 'pupil', 'pix2degX', 'pix2degY', 'velocityX', 'velocityY', 'whichEye'],
   "FileFormat": 'EDF',
   "RecordedEye": 'Right'
}

You should either correct the original files that are downloaded in s0, or add a script in s2 that corrects the *_physio.json files before running the BIDS validator.

Also, note that the StartTime is defined as "Start time in seconds in relation to the start of acquisition of the first data sample in the corresponding neural dataset". The current value of 3852115 for the example above would indicate that the eye tracking recording started about 44 days after the first volume of the corresponding functional run...

JWinawer commented 3 years ago

We could ask Eline how she made these. Or we could discard the eye-tracking files for this session and get a new sample dataset when CBI has tools for incorporating into BIDS.

JWinawer commented 3 years ago

From Eline: "I made it with a function called edft_to_BIDS.m, it's in the winawerlab git repository MRI_tools > BIDS > edf_to_BIDS.m I wrote it a long time ago, so it might be outdated."

We can either look at that code or just wait for CBI to finish implementing their conversion software. I vote for the latter.