-
Notifications
You must be signed in to change notification settings - Fork 32
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
Return layout subset #122
Comments
Technically the content of those files is loaded in the layout: Line 250 in 6c1dac6
But it seems that we don't have the code in BIDS = bids.layout(fullfile(pth_bids_example, 'ds001'));
bids.query(BIDS, 'metadata', 'sub', '01', 'run', '01', 'type', 'events')
ans =
struct with no fields.
% But we get this:
BIDS.subjects(1).func(4).meta
ans =
struct with fields:
onset: [158×1 double]
duration: [158×1 double]
trial_type: {158×1 cell}
cash_demean: [158×1 double]
control_pumps_demean: [158×1 double]
explode_demean: [158×1 double]
pumps_demean: [158×1 double]
response_time: [158×1 double] (Will add a test for this, because I doubt this is the intended behavior.) So I would not necessarily think this is needed for See #66 |
Yes, I've seen it. But you load them only for some modalities, and parce it. I propose to treat them as independent data files, for example querry for func will return something like:
So if one want to run some scripts on all fMRI, he has the list of both image and events, instead to try to generate filename from image name. |
I am not sure I follow. From the test for query: bids-matlab/tests/test_bids_query.m Line 63 in 6c1dac6
Sure there are still some issues with the getting metadata (#23, #79) and sure some reparsing is happening under the hood when querying for metada, but I am not sure to see where the issue is. |
But you can already do that, no?
|
Simple example: someone want to process T1w image with his script, which also needs some metadata from json. In actual state: If query returns list of subject structure: |
Probably (I didn't looked to much in query part). |
Technically we are not "yet" following the schema (see #104) but I see what you mean. Official schema support is on its way though see PR #121)
Yup we actually already have this problem in the PR #121 as the FLASH suffix is now deprecated and not encoded in the BIDS schema.
Actually, we try to leave the extensive validation to the validator but there is a bit of entity list validation at parsing.
Actually using the official schema is already a way to simplify the code (but work in progress). The issue of how to deal with several BIDS schema version though is an important one. One thing that could be done is to use "tolerant" option of the "layout" to actually allow parsing of dataset with almost no rule on filenaming except the |
Or just load the layout and run validation afterwards. It will significally simplify the loading part, and allow more complex verifications in validator part. For example check for magintude1 if phasediff is present, or presence of specific json fields and values. The main functional code will remain simple not chainging (once debugged), while the validator can increase the complexity folowwing the BIDS requirements. Validator can even automatically launched after the layout. |
I am actually reluctant to have layout return a structure that is not about a valid BIDS dataset by default. I would rather have the non-bids-compliance be somethings users have to put extra effort to opt-in. Having defaults follow "best practice" is actually a good way to nudge good behaviors. |
Easy:
|
Only if the best practices are not restrictive and not changing every month. Integration of new modalities can take years (qMRI and PET). |
@nbeliy moved your comment to a different issue. :-) |
The PR #124 will at least start taking care of the first point and allow to parse datasets in a schemaless fashion. Just need to switch the tolerant parameter of |
Make query return subset of layout instead of flat list
In current state
querry
returns flat lists of found data, subjects etc. This may create some difficulties during data processing, for ex. if one need to access to metadata in json file, he need to reparse the filenames.I propose that
querry
returns instead the either subset subject field, or full layout containing only selected data files. Retrieve a flat list of files from it is trivial, so it will nod add complexity if one just need data files, but it will provide additional metadata together with data files, if they are needed.Originally posted by @nbeliy in #60 (comment)
The text was updated successfully, but these errors were encountered: