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

Querying for modalities does not filter for sessions or subjects #65

Closed
Remi-Gau opened this issue Oct 25, 2020 · 2 comments · Fixed by #71
Closed

Querying for modalities does not filter for sessions or subjects #65

Remi-Gau opened this issue Oct 25, 2020 · 2 comments · Fixed by #71
Labels
bug Something isn't working

Comments

@Remi-Gau
Copy link
Collaborator

Remi-Gau commented Oct 25, 2020

Example from the 7T-trt dataset from bids-example

$ tree -d sub-0[12]
sub-01
├── ses-1
│   ├── anat
│   ├── fmap
│   └── func
└── ses-2
    ├── fmap
    └── func
sub-02
├── ses-1
│   ├── anat
│   ├── fmap
│   └── func
└── ses-2
    ├── fmap
    └── func

Actual behavior

BIDS = bids.layout(dataset_path);
bids.query(BIDS,  'modalities',  'sub',  '01',  'ses',  '2')

ans =

  1×3 cell array

    'anat'    'func'    'fmap'

Expected behavior

BIDS = bids.layout(dataset_path);
bids.query(BIDS,  'modalities',  'sub',  '01',  'ses',  '2')

ans =

  1×2 cell array

   'func'    'fmap'

Notes

This also applies to spm_bids

@Remi-Gau Remi-Gau added the bug Something isn't working label Oct 25, 2020
@Remi-Gau Remi-Gau changed the title querying for modalities for a specific modality does not care about the session querying for a specific modality does not care about the session Oct 25, 2020
@gllmflndn
Copy link
Collaborator

Confirmed. It is similar to #12: subjects, sessions and modalities were dealt with differently than the other keywords - they are qualitatively different but it seems that the code path can be the same. modalities is the last one treated separately.
I will open a pull request with a potential fix.

@gllmflndn gllmflndn changed the title querying for a specific modality does not care about the session Querying for modalities does not filter for sessions or subjects Oct 27, 2020
gllmflndn added a commit that referenced this issue Oct 28, 2020
… (#71)

* Fix for issue #65

* Return row instead of column vector of modality names.

* Add unit tests.
@Remi-Gau
Copy link
Collaborator Author

Fixed by PR #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants