-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with data2bids #2277
Comments
The issue with coordsystem file for some reason doesn't happen on the example dataset but does happen on our CTF datasets. Also with our dataset it puts "Other" in "MEGCoordinateSystem" which leads to a problem later when trying to read the data. For MEGIN data it puts "ElektaNeuromag" in this field which leads to the following error: Error using ft_affinecoordinates (line 271) Error in ft_convert_coordsys (line 157) Error in ft_prepare_layout>sens2lay (line 1335) Error in ft_prepare_layout (line 609) This can be fixed by changing the value to "Neuromag" |
There are multiple issues, I'll go over them one by one. GeneratedBy should be an array of objects in the JSON, and hence a cell-array of structs in the MATLAB cfg structure. That was not the case for the default; I fixed it now. I also added some on-the-fly conversion in case a single string is given instead of an array-of-strings, and if a single struct is given in case of an array-of-objects (or structs). |
Using the tutorial |
I cannot reproduce the HeadCoilCoordinates error and reading the code I don't see why the formatting would go wrong. If you say that you had to remove additional Line 1628 in d005931
|
The mapping between BIDS and FieldTrip coordinate systems was incomplete: the older |
you write
How could the data2bids code generate valid defaults for these fields? It could specify NaN, which would translate to `n/a' upon writing to the JSON and the validator would probably not complain any more, but I consider that worse than the current implementation. |
- change default for GeneratedBy - update cfg fields that should be a list-of-strings - update cfg fields that should be a list-of-objects
@vlitvak can you try again? |
I just added a commit that fixes a problem in the merging of the GeneratedBy field in dataset_description.json |
CTF runs without errors now. For MEGIN I get:
====================================================== File Path: Tabular file contains custom columns not described in a data dictionary
====================================================== |
Regarding mandatory fields, I suggest that you update the example scripts in the wiki because I used your example as a starting point, but those fields were not specified there and I had to figure out from the errors and the code what the problem is. |
The example script should indeed be updated so that its results pass the validator, I made a separate issue for that. The Regarding the |
Datasets generated with data2bids do not pass the BIDS validator https://bids-standard.github.io/bids-validator/
I generated an example from FT CTF dataset that reproduces some of them. There was also an error related to fiducials that is not generated here for some reason:
File Path: Invalid JSON file. The file is not formatted according the schema.
Type: Error
File: sub-PhantomPerceptPC_coordsystem.json
Location: bids/sub-PhantomPerceptPC/meg/sub-PhantomPerceptPC_coordsystem.json
Reason: Invalid JSON file. The file is not formatted according the schema.
Evidence: .HeadCoilCoordinates['nasion'][0] should be number
I managed to fix it by editing the coordsys file to be like:
"HeadCoilCoordinates": {
"nasion": [7.5093, 0.0, 0.0],
"left_ear": [0.0568, 7.45343, 0.0],
"right_ear": [-0.0568, -7.45343, 0.0]
}
(removed square brackets around each coordinate).
Finally, I suggest amending the example code at https://www.fieldtriptoolbox.org/example/bids_meg/ (and maybe elsewhere) to include the specification of mandatory fields without which the validator will through an error. These are:
cfg.meg.PowerLineFrequency
cfg.meg.DewarPosition
cfg.meg.SoftwareFilters
cfg.meg.DigitizedLandmarks
cfg.meg.DigitizedHeadPoints
Alternatively, the code could have defaults for these fields.
conv2bids_ctf_test.zip
The text was updated successfully, but these errors were encountered: