bioimagesuiteweb / bisweb

This is the repository for the BioImage Suite Web Project
https://bioimagesuiteweb.github.io/webapp/
Apache License 2.0
78 stars 32 forks source link

Support "sparse remote access" to nii.gz files? #133

Open yarikoptic opened 2 years ago

yarikoptic commented 2 years ago

I feel like we chatted about it but I failed to find an issue, so here it comes (may be again).

ATM bisweb requires download of the file to the client machine to be visualized. May be that could be avoided if bisweb would have done desired HTTP Range requests (similarly to how https://github.com/fsspec/filesystem_spec and using it datalad-fuse and various other libraries do) for only needed data -- that would allow to visualize data without requiring entire volume download.

Why needed: In dandiarchive.org we have some "sizeable" .nii.gz files in the dandiarchive , e.g. https://dandiarchive.org/dandiset/000026/draft/files?location=derivatives%2Fmri_average%2Fsub-I41%2F contains 2.6GB .nii.gz available via https://api.dandiarchive.org/api/assets/4bb02786-9998-4c2b-b01b-7e2f2aa42d2c/download/ which is (pardon the filename)

$> nib-ls blah.nii.gz
blah.nii.gz float32 [1200, 1110, 576] 0.15x0.15x0.15   sform

May be for that purpose, for integration with https://github.com/pauldmccarthy/indexed_gzip could be used to index gzip to allow for random access (could even be 4 separate indexes - one per each of possible dimensions to slice ijkt). E.g. it is used by https://github.com/mxmlnkn/ratarmount to provide random access within gzipped tars, and then bisweb provided fetching and local caching for only needed/requested slices of data?