Skip to content

Add ndi.lightsheet: napariViewLightsheet console script + PyramidReader (scaffold) - #13

Closed
stevevanhooser wants to merge 1 commit into
mainfrom
claude/lightsheet-zarr-ndi-viewer-djp5vk
Closed

stevevanhooser wants to merge 1 commit into
mainfrom
claude/lightsheet-zarr-ndi-viewer-djp5vk

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Summary

Python-side companion to the lightsheet OME-Zarr ingest landing on VH-Lab/NDI-matlab#<link> on the same branch name.

Adds:

  • src/ndi/lightsheet/napari_view.py — the console script the MATLAB LightsheetZarrManager shells out to (via /usr/local/bin/napariViewLightsheet). Argument set matches ndi.fun.doc.lightsheet.viewCommand in NDI-matlab exactly.
  • src/ndi/lightsheet/pyramid_reader.py — the reader that will open the NDI session, resolve the parent lightsheetZarrPyramid document, walk its lightsheetZarrLevel children via depends_on, and hand napari a list of lazy dask multiscale arrays that fetch chunk.bin_# files through the NDI cloud API. Every hook is present; each next-step body raises NotImplementedError with a pointer at the design README.
  • scripts/napariViewLightsheet — bash wrapper that scrubs LD_LIBRARY_PATH / DYLD_* / DYLD_FALLBACK_LIBRARY_PATH (MATLAB pollutes them) before exec'ing the console script. Same pattern the GEF viewer expects.

Scope note

Scaffold — every user-facing piece is wired but the chunk fetcher, session-open, depends_on query, and magicgui controls are NotImplementedErrors with pointers at the package README's "what still needs building" section. The console script parses the full argument set and reports the missing piece cleanly to stderr today, so the MATLAB GUI's View button already produces a legible error rather than hanging.

Also NOT yet edited: pyproject.toml. The README lists the additions to make ([project.optional-dependencies].viewer with napari/magicgui/qtpy/dask/zarr/numcodecs and [project.scripts] napariViewLightsheet = "ndi.lightsheet.napari_view:main"). Held out of this PR so the base install stays lean until napari is actually needed.

Test plan

  • python -m ndi.lightsheet.napari_view --help prints the argument set matching the MATLAB viewCommand flags.
  • napariViewLightsheet foo --pyramid abc (without the pyproject edit) prints a clean stderr and exits non-zero.
  • After the pyproject edit lands, napariViewLightsheet is on PATH after pip install -e .[viewer].
  • Once PyramidReader.open is implemented, end-to-end napariViewLightsheet <session> --pyramid <id> opens napari with a multiscale layer.

Follow-ups

  1. Implement PyramidReader.open / list_levels / multiscale / sibling / attach_controls — see src/ndi/lightsheet/README-lightsheet-zarr.md.
  2. Add pyproject.toml [project.optional-dependencies].viewer and [project.scripts] entry.
  3. Install scripts/napariViewLightsheet at /usr/local/bin/napariViewLightsheet in the environment setup docs (mirrors what GEF's napariViewGEF will need).

🤖 Generated with Claude Code

https://claude.ai/code/session_01N67xH9BejMzZp4GNAq8m7w


Generated by Claude Code

…er (scaffold)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N67xH9BejMzZp4GNAq8m7w

Copy link
Copy Markdown
Contributor Author

Closing — wrong repo. The active NDI-python is Waltham-Data-Science/NDI-python, which already carries the [project.scripts] napariViewGEF = "ndi.gui.app.genepyramid.cli:main" entry and the src/ndi/gui/app/<feature>/{cli,viewer,multiscale}.py layout that the lightsheet-zarr code needs to mirror. Re-opening the equivalent PR against Waltham-Data-Science/NDI-python on the same branch name (claude/lightsheet-zarr-ndi-viewer-djp5vk).


Generated by Claude Code

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