Skip to content
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

Fail to capture all EEG files and wrong number of subjects #97

Closed
arnodelorme opened this issue Nov 13, 2020 · 5 comments
Closed

Fail to capture all EEG files and wrong number of subjects #97

arnodelorme opened this issue Nov 13, 2020 · 5 comments

Comments

@arnodelorme
Copy link

Only capture the raw data, channel and event file. Misses the JSON files.
Also, there are only 2 subjects (with 3 sessions each). Yet the program think there are 6 subjects

Screen Shot 2020-11-13 at 10 49 21 AM

Screen Shot 2020-11-13 at 10 49 12 AM

@Remi-Gau
Copy link
Collaborator

hey @arnodelorme

Try to use bids.query to access specific pieces of information of the layout. This is how the whole thing has been designed. 😉

I still need to write some sort of official doc on this but in the mean time you can look at test_bids_query as a source of unofficial doc.

In your case, what do the following give you?

bids.query(res, 'subjects')
bids.query(res, 'data', 'sub', '01')

Also I am pretty sure that JSON files are not "indexed". Am I right @gllmflndn?

If you want to get the content of some JSON file you would need to do something like this:

bids.query(res, 'metadata', 'sub', '01', 'task', 'Experiment')

@arnodelorme
Copy link
Author

Why not load it all?

@Remi-Gau
Copy link
Collaborator

Not sure why that initial decision was made though I suspect that this in part related to dealing with the inheritance principle which implies that the metadata about a given file could be spread in several JSON, so this is dealt with on the fly when metadata is requested.

@Remi-Gau
Copy link
Collaborator

hey @arnodelorme

PR #47 should be able to index the json files that are in any "modality" folder a subject if you ask for a schema-less layout.

use_schema = true();
BIDS = bids.layout(fullfile(pth_bids_example, 'eeg_rishikesh'), use_schema);
bids.query(BIDS, 'data', 'sub', '001', 'ses', '01')

ans =

  3×1 cell array

    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_channels.tsv'
    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_eeg.bdf'
    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_events.tsv'

%%
use_schema = false();
BIDS = bids.layout(fullfile(pth_bids_example, 'eeg_rishikesh'), use_schema);
bids.query(BIDS, 'data', 'sub', '001', 'ses', '01')

ans =

  4×1 cell array

    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_channels.tsv'
    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_eeg.bdf'
    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_eeg.json'
    'bids-examples/eeg_rishikesh/sub-001/ses-01/eeg/sub-001_ses-01_task-meditation_events.tsv'

I have shortened the full path in the copy-paste to make it easier to read.

Will merge the PR in the dev branch

@arnodelorme
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants