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

⚡ Improvement: BIDS Inheritance #1352

Open
shnizzedy opened this issue Aug 26, 2020 · 2 comments
Open

⚡ Improvement: BIDS Inheritance #1352

shnizzedy opened this issue Aug 26, 2020 · 2 comments
Assignees
Labels
BIDS https://bids-specification.readthedocs.io/ improvement support

Comments

@shnizzedy
Copy link
Member

Related problem

If a BIDS directory contains sidecar information split between file-level and directory-level, C-PAC produces outputs like the following if the parameters C-PAC is looking for are in a higher-level sidecar.

Parsing /bids_dataset..
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'objectcategories', 'run': '3', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-objectcategories_run-3_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'retmapclw', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-retmapclw_run-1_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'objectcategories', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-objectcategories_run-1_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'retmapcon', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-retmapcon_run-1_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'movielocalizer', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-movielocalizer_run-1_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'retmapexp', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-retmapexp_run-1_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'objectcategories', 'run': '2', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-objectcategories_run-2_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'retmapccw', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-retmapccw_run-1_bold.nii.gz, is this a problem?
{'site': 'none', 'sub': '17', 'ses': 'localizer', 'task': 'objectcategories', 'run': '4', 'scantype': 'bold'}
Did not receive any parameters for sub-17/ses-localizer/func/sub-17_ses-localizer_task-objectcategories_run-4_bold.nii.gz, is this a problem?
Parsing /bids_dataset..
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'scantype': 'T1w'}
Did not receive any parameters for site-1/sub-18/ses-movie/anat/sub-18_ses-movie_T1w.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '1', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-1_bold.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '8', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-8_bold.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '7', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-7_bold.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '5', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-5_bold.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '6', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-6_bold.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '4', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-4_bold.nii.gz, is this a problem?
{'site': 'site1', 'sub': '18', 'ses': 'movie', 'task': 'movie', 'run': '2', 'scantype': 'bold'}
Did not receive any parameters for site-1/sub-18/ses-movie/func/sub-18_ses-movie_task-movie_run-2_bold.nii.gz, is this a problem?

If the more specific sidecars are removed, however, C-PAC discovers the parameters in the higher-level sidecar.

Proposed feature

Update C-PAC's sidecar discovery to follow BIDS' Inheritance Principle

There is no notion of "unsetting" a key/value pair. Once a key/value pair is set in a given level in the dataset, lower down in the hierarchy that key/value pair will always have some assigned value.
[…]
If the .json file at the more shallow level contains key-value-pairs that are not present in the .json file at the deeper level, these key-value-pairs are inherited by the .json file at the deeper level (but NOT vice versa!).

@shnizzedy shnizzedy added improvement support BIDS https://bids-specification.readthedocs.io/ labels Aug 26, 2020
@shnizzedy shnizzedy self-assigned this Aug 27, 2020
@shnizzedy shnizzedy added the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Sep 30, 2021
@shnizzedy shnizzedy removed the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Feb 10, 2022
@shnizzedy
Copy link
Member Author

Possibly related: #2103

@sgiavasis
Copy link
Collaborator

We'll be considering migrating to either bids2table, or possibly but less likely, PyBIDS in the near future (v1.8.8).
@e-kenneally is starting to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BIDS https://bids-specification.readthedocs.io/ improvement support
Projects
None yet
Development

No branches or pull requests

2 participants