snakebids icon indicating copy to clipboard operation
snakebids copied to clipboard

Add an option in generate_inputs to ignore files from pybids parsing?

Open akhanf opened this issue 1 year ago • 1 comments

The problem

Would be useful to be able to ignore specific files when parsing a bids dataset. In my case, it is because I'm now parsing some datasets that include zarr files, folders with a potentially huge number of files, so makes indexing the dataset needlessly inefficient, but was chatting with @pvandyken about some other potential uses for this (e.g. removing files out of bids spec that are causing conflicts with parsing)..

Turns out that pybids doesn't actually make use of the .bidsignore file, so that option is out.

Pybids does have an ignore option in their layout indexer that takes a list of strings or regex: https://bids-standard.github.io/pybids/generated/bids.layout.index.BIDSLayoutIndexer.html#bids.layout.index.BIDSLayoutIndexer

What do you think of simply exposing that parameter in generate_inputs?

akhanf avatar Feb 20 '24 21:02 akhanf

I'm fine with that. AFAIK this would have no effect when using a database, but it at least creates the option.

In principle snakebids could take on the reading of .bidsignore itself, but I'd rather punt that down to a potential future integration with rsbids

pvandyken avatar Feb 20 '24 22:02 pvandyken

closing this since the particular use case is fixed now in pybids (ie ignoring .zarr directories)

akhanf avatar Jun 03 '24 19:06 akhanf