Skip to content

Comments

Zarr float64#884

Closed
fcollman wants to merge 5 commits intogoogle:masterfrom
fcollman:zarr_float64
Closed

Zarr float64#884
fcollman wants to merge 5 commits intogoogle:masterfrom
fcollman:zarr_float64

Conversation

@fcollman
Copy link
Contributor

this adds float64 support to zarr via downcasting like nifti.. addresses #875 following along the pattern established with #849

@fcollman
Copy link
Contributor Author

I have tested this using this snippet test to create a 64 bit float zarr and serve it to this branch

# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "zarr",
#     "numpy",
#     "neuroglancer",
# ]
# ///
import pathlib
import shutil
import time


import numpy as np
import zarr

import neuroglancer.static_file_server

# Ensure we start with a clean directory for the tutorial
script_dir = pathlib.Path(__file__).resolve().parent
datadir = script_dir / ".." / "data" / "zarr-tutorial"
datadir = datadir.resolve()
if datadir.exists():
    shutil.rmtree(datadir)
datadir.mkdir(parents=True, exist_ok=True)

output = datadir / "test.zarr"
z = zarr.create_array(shape=(40, 50, 50), chunks=(10, 10, 10), dtype="f8", store=output, compressors=None)
z[:] = np.random.rand(40, 50, 50)

# Serve ../data on localhost for Neuroglancer
data_dir = script_dir / ".." / "data"
data_dir = data_dir.resolve()
server = neuroglancer.static_file_server.StaticFileServer(
    str(data_dir), bind_address="127.0.0.1", daemon=True
)

print(f"Data directory served at: {server.url}")

print("Press Ctrl+C to stop the server.")
try:
    while True:
        time.sleep(1)
except KeyboardInterrupt:
    pass

@fcollman
Copy link
Contributor Author

this is not functioning properly.. need to go back to drawing board.

@fcollman fcollman closed this Feb 22, 2026
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.

1 participant