Add .get_entities() method to BIDSLayout
See original GitHub issueCurrently, you can get valid entities by running BIDSLayout(bids_root).entities
and a little parsing. It would be nice to have a helper function such as bids.layout.list_entities()
:
def list_entities(domains=('bids',)):
res = []
for domain in domains:
res.extend(...) # Parse the entities from the JSON files
return res
The reason this comes up is that, currently, nipype.interfaces.io.BIDSDataGrabber
manually parses the JSON files, found in a path relative to bids.__file__
. This isn’t great.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
bids.layout.BIDSLayout — PyBIDS 0.15.5 documentation
This provides a convenient way to restrict file indexing to only those files defined in the “core” BIDS spec, as setting validate=True will...
Read more >pybids/layout.py at master · bids-standard/pybids - GitHub
Python tools for querying and manipulating BIDS datasets. - pybids/layout.py at master · bids-standard/pybids.
Read more >Querying Acquisition Info and Metadata with pybids - Neurostars
I'd like to query the acquisition info (TR, TE, PED etc) and some meta-data for a given dataset in BIDS format.
Read more >Princeton Neuroscience Institute - rtCloud documentation
installation process must be added to a list of trusted certificates on your ... getReadme() → bids.layout. ... getEntities() → dict.
Read more >cloud-bids-layout - PyPI
Cloud-BIDS-Layout: Use pybids with Amazon S3. ... The user can then use pybids' familiar .get() method to select a subset of the study...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Following up on this, in 0.8, you can do
Config.load('bids')
to get back aConfig
object that has a dictionary of entities only valid for that config. This doesn’t require populating a layout, but it only works for a single config at a time. So at this point it would be very straightforward to add a static method inBIDSLayout
that takes a list of config names and returns the union of available entities across all resultingConfig
objects.0.9 adds a
get_entities()
method that acceptsscope
andis_metadata
arguments, where the former controls where to look for entities, and the latter allows you to restrict to only metadata or non-metadata entities if desired.