snakebids icon indicating copy to clipboard operation
snakebids copied to clipboard

`BidsDataset` advanced component selection

Open pvandyken opened this issue 2 years ago • 1 comments

As proposed in #209, this will be an API allowing the selection of multiple components from a single Dataset. All would return a new dataset containing only the selected components.

The functions are outlined below:

  • BidsDataset[<one or more components>]

    Extends the current api allowing the selection of just one component. If multiple components are provided, a new dataset is returned containing just those components. This is potentially useful in combination with intersection type calculations.

  • BidsDataset.drop(*components)

    As above, but drops components instead of selecting

  • BidsDataset.with_entities(*entities, exact: bool = False) -> BidsDataset

    Return dataset containing only the components with the given entities. Setting exact=True also filters out components with extra entities beyond the selected *entities. Most likely use here is in combination with BidsDataset.expand to expand over a consensus of specific entities.

  • BidsDataset.without_entities(*entities) -> BidsDataset

    As above, but inverse

pvandyken avatar Feb 11 '23 21:02 pvandyken

The first point will be pretty easy to implement with MultiSelectDict

tkkuehn avatar Jun 02 '23 16:06 tkkuehn