-
Notifications
You must be signed in to change notification settings - Fork 124
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
layout.get
not returning subject directory paths for datasets with no session layer
#978
Comments
To be honest, I'm surprised anybody uses I'm not sure that we want to support this long-term, so it might be best to take another approach. What about: subject_dirs = [Path(layout.root) / f'sub-{subject}' for subject in layout.get_subjects()] |
Hi @effigies, thanks again for your advice on this. We ended up going with your suggested method to extract session / subject directories. Just letting you know that we also noticed during experimenting that import bids
layout = bids.BIDSLayout("bids-examples/ieeg_motorMiller2007")
layout.get(subject="cc", session="01", target="session", return_type="dir")
Out[]: []
# BUT:
layout.get_sessions(subject="cc")
Out[]: ['01'] This does seem to reinforce your statement that In light of this, would it make sense to update the docs (https://bids-standard.github.io/pybids/examples/pybids_tutorial.html#other-return-type-values) to either remove reference to this parameter, or warn about its usage? Can also open another issue for the docs update if that would be helpful. |
Yes, I think it would be a good idea to discourage use of this option. |
Hi there,
I would like to use
layout.get
to get subject-level directory paths for BIDS datasets, but am getting unexpected results for datasets that do not have a session layer (but still have imaging data), e.g. bids-examples dataset "ds003":Commands used to load the dataset and try to fetch the directory path for a specific subject:
In the last line, using
target="subject", return_type="dir"
returns an empty list as opposed to a list of paths, even though pybids appears to be recognizing that there is subject-level data. This issue persists even whensubject
isn't specified inlayout.get
.Strangely, not all the
bids-examples
datasets which are missing a session layer cause this behaviour. For example I've noticed it for ds003 and eeg_ds000117, but eeg_cbm returns the subject paths as expected:Not sure if this is a bug or if the inconsistent behavior is due to specific differences in the dataset structure. Any help on this would be much appreciated!
The text was updated successfully, but these errors were encountered: