Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Read from http sources #37

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

tbirdso
Copy link
Collaborator

@tbirdso tbirdso commented Aug 1, 2023

Overview

Adds support for reading from remote OME-Zarr stores compatible with the tensorstore http key-value store driver.

Notes

The Tensorstore http key-value store driver provides an interface to access remote OME-Zarr data via http or https connection. Remote OME-Zarr file resources must be available as a URL, i.e. https://1.2.3.4:8080/path/to/image.zarr/.zgroup, https://1.2.3.4:8080/path/to/image.zarr/0/..., etc.

Compatible with reading from Amazon AWS S3 buckets, formed as https://<bucket-name>.s3.amazonaws.com/path/to/image.zarr.

Automated test coverage is provided in Python by spawning a background Python web server to serve files from the local test directory over http. A C++ test is included as a utility for manual testing, but is not automated.

EDIT: I now recall that Python tests are not included in ITK test automation. http support may be tested manually with the following command:

path/to/build> ctest -C "<build-type>" -R "HTTP"

Output

Relevant output from Python HTTP test run on my local machine shows that local zarr store is successfully queried via the Python HTTP web server:

...
12: Running itkImageFileWriterIF3... done
# vvvvvvvvvvvvv Output from Python HTTP server showing GET requests to Zarr directory vvvvvvvvvvv #
12: 127.0.0.1 - - [01/Aug/2023 09:44:57] "GET /cthead1.zarr/.zgroup HTTP/1.1" 200 -
12: 127.0.0.1 - - [01/Aug/2023 09:44:57] "GET /cthead1.zarr/.zattrs HTTP/1.1" 200 -
12: 127.0.0.1 - - [01/Aug/2023 09:44:57] "GET /cthead1.zarr/s0/.zarray HTTP/1.1" 200 -
12: 127.0.0.1 - - [01/Aug/2023 09:44:57] "GET /cthead1.zarr/.zgroup HTTP/1.1" 200 -
12: 127.0.0.1 - - [01/Aug/2023 09:44:57] "GET /cthead1.zarr/.zattrs HTTP/1.1" 200 -
12: 127.0.0.1 - - [01/Aug/2023 09:44:57] "GET /cthead1.zarr/s0/0.0.0 HTTP/1.1" 200 -
12: Running itkImageFileReaderIF3... done
12: Loading ITKBridgeNumPy... done
...
12:
1/1 Test #12: itkOMEZarrNGFFHTTPReadTestPython ...   Passed    3.04 sec

References

https://google.github.io/tensorstore/kvstore/http/index.html

@tbirdso tbirdso requested review from thewtex and dzenanz August 1, 2023 00:18
@tbirdso tbirdso linked an issue Aug 1, 2023 that may be closed by this pull request
@tbirdso tbirdso mentioned this pull request Aug 1, 2023
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, I have not tried it.

test/itkOMEZarrNGFFHTTPTest.cxx Outdated Show resolved Hide resolved
wrapping/test/CMakeLists.txt Outdated Show resolved Hide resolved
test/itkOMEZarrNGFFHTTPTest.cxx Outdated Show resolved Hide resolved
Add support for reading from Zarr stores available remotely via `http`
or `https`, such as those served over a local network or hosted on the
cloud with AWS S3.

Includes automated tests referencing OME-Zarr data detailed in the Open
Microscopy Environment (OME) GitHub organization:

https://github.com/ome/ome-ngff-prototypes

Also includes non-automated Python tests for reading from local disk
over HTTP and C++ utility for generic OME-Zarr reading.
@tbirdso tbirdso merged commit 0585902 into InsightSoftwareConsortium:master Aug 2, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cloud support
3 participants