Core functionality is implemented in https://github.com/datalad/datalad-fuse/ and a good "example" could be (claude coded)
https://github.com/OpenNeuroStudies/OpenNeuroStudies/blob/master/code/src/bids_studies/sparse/access.py#L298 which boils down to use of FsspecAdapter as the "opener" for the file and passing it to nibabel invocation (like also done there in OpenNeuroStudies) as any other file. some code is in https://github.com/OpenNeuroStudies/OpenNeuroStudies/blob/master/code/src/openneuro_studies/metadata/summary_extractor.py#L387 but looks over-aingineered -- should be just passing that pointer to nibabels constructor.
Core functionality is implemented in https://github.com/datalad/datalad-fuse/ and a good "example" could be (claude coded)
https://github.com/OpenNeuroStudies/OpenNeuroStudies/blob/master/code/src/bids_studies/sparse/access.py#L298 which boils down to use of FsspecAdapter as the "opener" for the file and passing it to nibabel invocation (like also done there in OpenNeuroStudies) as any other file. some code is in https://github.com/OpenNeuroStudies/OpenNeuroStudies/blob/master/code/src/openneuro_studies/metadata/summary_extractor.py#L387 but looks over-aingineered -- should be just passing that pointer to nibabels constructor.