Skip to content

Data viewer: watch an acquisition as it is written (mesospim_viewer + TCZYX OME-Zarr writer) - #117

Open
thomdehoog wants to merge 90 commits into
mesoSPIM:release/candidate-py312from
thomdehoog:mesospim-viewer
Open

thomdehoog wants to merge 90 commits into
mesoSPIM:release/candidate-py312from
thomdehoog:mesospim-viewer

Conversation

@thomdehoog

@thomdehoog thomdehoog commented Oct 1, 2026 •

Copy link
Copy Markdown

A Data viewer for mesoSPIM-control. View > Open Data Viewer opens a window that follows the acquisition being written and shows each tile as it lands: all channels, in 2D or 3D, placed by stage position. View > Open Dataset in Data Viewer... opens a dataset from disk in the same window: OME-Zarr 0.4 and 0.5 (ZYX with C and T in any combination), and runs saved as TIFF, raw or HDF5.

It is a neuroglancer page in a Qt window, driven from Python. The stack being acquired is drawn plane by plane from the camera's frames; the tile on disk takes its place once the stack is complete.

What is in it

  1. MP_OME_Zarr_TCZYX_Writer: one (t, c, z, y, x) OME-Zarr store per tile. Channels go along c, time points are appended along t, so no chunk or shard spans either. This is the format the live viewer reads best. The existing OME-Zarr writers now also write each store's channel name and colour, and a smaller overview copy per tile.
  2. The window: mesoSPIM/src/mesoSPIM_DataViewer.py, two entries in the View menu. File > Exit closes it too.
  3. The viewer: mesoSPIM/src/mesospim_viewer/.
  4. Install: PyQtWebEngine==5.15.7 in pyproject.toml and requirements-conda-mamba.txt.
  5. Config (optional): data_viewer = {'gpu_memory_MB': ..., 'system_memory_MB': ...}. Left out, the viewer takes a share of what the PC has (half the graphics card, an eighth of the memory, at most 4000 and 8000 MB).
  6. Docs: docs/source/data_viewer.rst (using and testing it) and docs/source/file_formats.rst.

The panel

  • Load data: Open from folder, and a Live switch. With Live on, a new run comes in at the top, marked Live, and turns Saved when it ends.
  • Acquisitions: an eye to show or hide each; a click selects one, folds out its positions and frames it; a click on a position zooms to that tile; the × takes a saved one off the list (its files stay on disk).
  • The map of the tiles, linked to the picture: the tile being acquired, the ones still to come, and a click that takes the view to a tile.
  • Channels of the selected acquisition: eye, colour, Auto contrast and a histogram.
  • The picture: Z and T sliders, a readout under the pointer, 3D (volume, Max/Blend/Min, detail, Top/Front/Side).

Changes since the last update of this PR

  • Large acquisitions: one overview picture stands in for the tiles when zoomed out, and the work per frame no longer grows with the number of tiles. An acquisition finished long ago opens without listing its tiles' folders.
  • Runs saved as TIFF, raw or HDF5 can be opened, not only OME-Zarr.
  • Time lapse: a tile that gains a time point keeps its picture. When a time lapse ends or is cancelled, the table's file names go back to what they were.
  • Memory: the viewer chooses its limits from what the PC has; the configuration can set them.
  • Writers: a writer process that dies no longer freezes the acquisition or the Stop button (the status line says NOT SAVING, the next stack is written as usual). The TCZYX writer handles single rows, one laser with two filters, and stopped stacks, and has its own page in the file-naming wizard.
  • Merged with the current release/candidate-py312, including the Windows path-length check. The TCZYX writer answers that check for its own layout.

Found and fixed on the microscope PC (Windows)

  • MP_OME_Zarr_Writer stopped at every first stack with NameError: name 'laser' is not defined. It came from this branch's channel names meeting 4c198d8 (shorter side-file names) on the release branch; release/candidate-py312 alone is fine. A new test, test_omezarr_mp_writer.py, writes one stack through this writer.
  • watch.py timed its work with time.monotonic(), which on Windows moves only every ~15 ms; it now uses time.perf_counter(). A test checked paths for "/1", which fails on Windows.
  • In a time lapse, the side files of a time point are named <name>_Time003_<tile>_... (they were <name>.ome_Time003.zarr_<tile>_...).
  • After Stop, the status line says Stopped: saving what was acquired so far.... A large OME-Zarr stack took 13 to 19 s to finish writing here, which looked like a hang.
  • A list refused because its paths would be too long for Windows is now also in the log.
  • A big dataset at full detail blanked the window. A 25x acquisition saved with chunks of 240 MB (64 x 1264 x 1480, sharded), in 3D at the highest Detail, zoomed in: the process that draws the page grew from 2 GB to 16 GB in twenty seconds and was ended, and the window stayed blank without a word in the log. The engine's memory limits count a chunk only once it has arrived, and eight were fetched at once. Now the page fetches fewer at once where chunks are large (one at a time for this dataset, eight as before for ordinary ones); the same steps peak at 11 GB. And if the page's process ends all the same, the window starts the page again with what was shown, says so on the picture and in the log.

Qt WebEngine is Chromium 83

PyQtWebEngine 5.15 renders with Chromium 83, older than neuroglancer expects. source/src/legacy_browser.js adds the missing browser features where they are missing, and the build targets Chrome 83. On the microscope PC (RTX 5080), turning the 3D volume draws about 3 frames a second (a frame every 333 ms); panning and zooming in 2D take 50 and 33 ms. The old Chromium is the likely reason; this PR does not change it.

Tested

On a mesoSPIM PC (Windows 11, i9-9900K, 128 GB, NVIDIA RTX 5080), in demo mode, following mesoSPIM/test/mesospim_viewer/WINDOWS_CHECK.md. The full runs were made at 252ed76, before the fixes above and before the merge with the release branch:

  • Automatic tests with the Qt window tests on: 454 passed, 3 failed, 1 skipped (needs Node). Two failures were the Windows problems above; with the fixes their two test files pass (57 tests). The third is the timing-sensitive test_realistic.py::...[feed], which passes when run alone. After the merge, the writer and Data viewer window tests were run again (83 passed); the full suite was not.
  • The rehearsal in the real window (python -m mesoSPIM.test.mesospim_viewer.rehearsal): 11 of 11. In a second run after the fixes, 10 of 11: "The map takes the view to a tile" failed once (the view stopped at x 139.6, short of 151.5). It had passed before and was not looked into.
  • The checks by hand in docs/source/data_viewer.rst that can be done in demo mode: 12 of 12. Checks 2, 7, 13 and 18 were done by hand in mesoSPIM's windows. Checks 1, 3, 4, 5, 6, 8, 14 and 15 were driven from a script that runs mesoSPIM and presses Run, Run selected acquisition and Stop, closes and resizes the viewer, and ends the writer process. They cover sharded data, rows run one at a time, one laser with two filters, Stop in the second channel, very short stacks with both OME-Zarr writers, closing the viewer during a run, a writer process ended on purpose, and the same time point again after ten minutes.

With the microscope's hardware connected (pco.edge 4.2 bi, ASI Tiger, cDAQ), mesoSPIM started from this branch and an acquisition from October was opened in the viewer (25x, one tile, two channels, 33 GB per channel). This found the blank window above; with the fix, the same steps work. After that fix, the page build, page, interaction and window tests pass (51, then 15 again after a last change).

Not yet tested: a new acquisition on the microscope. Above all, check 17: do neighbouring tiles line up, for OME-Zarr, TIFF and HDF5 runs.

Known, not fixed here

  • Turning the volume in 3D is slow in the Qt window (see above).
  • The rehearsal's map check failed once in two runs (see Tested).
  • With very large chunks the picture sharpens slowly, because they are fetched one at a time. The page's process still reached 11 GB on that dataset, above the viewer's own limit of 8 GB.
  • An acquisition saved before the writers named each store's channel (no omero block) is shown as one channel, even when its stores are of two lasers: the viewer reads the channel from the store's metadata only, not from its folder name.

🤖 Generated with Claude Code

claude and others added 4 commits October 1, 2026 17:03
…tile

A mode of the multi-process OME-Zarr writer that writes one store per tile:
channels along c, the time points of a time lapse appended along t (the
_Time### mark mesoSPIM puts in file names is read and stripped, so every time
point lands in the same store), stage position in the OME translation, channel
names and colours in the omero block. No chunk or shard spans a channel or a
time point, and a shard is always exactly one z-chunk deep, so every shard is
written in one go and a later stack only ever adds files.

Everything lives in two new files. The plugin subclasses OMEZarrWriterMP, and
omezarr_writer_tczyx.py opens the store as tczyx and hands the untouched live
pyramid pipeline (Live3DPyramidWriter) a window onto [t, c] of each array;
omezarr_writer.py is not changed.

Tests in mesoSPIM/test/test_omezarr_tczyx_writer.py; a shard-vs-chunk write
benchmark in mesoSPIM/test/benchmark_omezarr_shards.py.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mxm7sBkFDCQdtXSroHsxp
…hown as it lands

A window that shows the acquisition being written, tile by tile and time point
by time point, following the newest acquisition of the data folder with a
dropdown for earlier ones. The window itself is the separate mesospim_view
package (a neuroglancer page driven from Python); without it the menu entry
says how to install it, and mesoSPIM-control gains no dependency.

All of it is in the new mesoSPIM_DataViewer.py: the main window connects its
menu action to it (one line), and mesoSPIM_Control.py calls prepare_qt() before
any QApplication exists, because Qt allows the WebEngine import only then. A
docs page covers what is on screen, installing, a test without a microscope
and troubleshooting.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mxm7sBkFDCQdtXSroHsxp
…ospim_viewer)

The Data viewer window no longer needs a separate package. The viewer, a
neuroglancer page driven from Python, moves in from ZMART-viewer
(mesospim_view, thomdehoog/ZMART-viewer#2) as mesoSPIM/src/mesospim_viewer:

- page_source/ is the page, page/ the built page, committed so the
  microscope PC needs no Node. Only changing the page needs Node:
  npm ci && npm run build in page_source/, then commit page/.
- The window only needs PyQtWebEngine: pip install -e ".[data-viewer]".
- Tests in mesoSPIM/test/mesospim_viewer; the picture tests skip without
  Playwright and a Chromium, the window test runs with
  MESOSPIM_VIEWER_QT_TESTS=1.

The window is Qt WebEngine 5.15, i.e. Chromium 83, older than what
neuroglancer 2.41 expects: without AbortSignal.throwIfAborted every image
source failed and the window stayed black. page_source/src/legacy_browser.js
adds the missing browser features where they are absent (page and both
workers), and the build targets Chrome 83. Verified in the Qt window on
an NVIDIA T400: both channels drawn, all visible chunks loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
…the Windows race

split_time_index rebuilt the path through pathlib, so on Windows
'/data/run/Sample.ome_Time003.zarr' came back with backslashes. Only the
name is changed now; the folder part is returned as given.

The end-to-end writer test is marked xfail on Windows: OmeZarrWriterMP.finalize
closes the parent's shared-memory handle before the writer process has
attached, and on Windows the block then no longer exists ('wnsm_...' not
found). The test's stacks are short enough to finish before the process
starts. The race is in the existing MP writer, left as it is here.

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

Copy link
Copy Markdown
Member

Hi, Thom,
Thank you for PR, looks really nice!

Unfortunately I got an error at the launch of the Viewer, please see below. So the auto-install PyQtWebEngine didnt work at launch as intended (I restarted twice to confirm). When I did pip install PyQtWebEngine manually the viewer opened.

Can the Viewer work for a ZARR dataset which is not being acquired, but stored somewhere on a disk? This would be very nice for testing of browsing existing datasets.

Does it work only with datasets in TCZYX order? Neuroglancer itself can read ZYX datasets (t and c axes need to be dragged in GUI for correct viz, otherwise standard setup).

Thank you!

File "C:\Users\Public\GitHub-public\mesoSPIM-control\mesoSPIM\src\mesoSPIM_MainWindow.py", line 467, in <lambda> self.actionOpen_Data_Viewer.triggered.connect(lambda: mesoSPIM_DataViewer.open_window(self)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Public\GitHub-public\mesoSPIM-control\mesoSPIM\src\mesoSPIM_DataViewer.py", line 68, in open_window window = make_window_class()(folder) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Public\GitHub-public\mesoSPIM-control\mesoSPIM\src\mesospim_viewer\window.py", line 31, in make_window_class qt = _qt() ^^^^^ File "C:\Users\Public\GitHub-public\mesoSPIM-control\mesoSPIM\src\mesospim_viewer\viewer.py", line 378, in _qt raise ImportError("no Qt WebEngine binding found (" + "; ".join(errors) + ")") ImportError: no Qt WebEngine binding found (PyQt5: No module named 'PyQt5.QtWebEngineWidgets'; PyQt6: No module named 'PyQt6'; PySide6: No module named 'PySide6'; PySide2: No module named 'PySide2')

claude and others added 18 commits October 2, 2026 17:03
…e hint when it is missing

PyQtWebEngine was an optional extra ([data-viewer]), so a plain
`pip install -e .` left it out and the menu entry failed. It is now a
regular dependency, as it already is in requirements-conda-mamba.txt.

When it is missing all the same, the menu entry now shows the install
message instead of a traceback: the web view is looked for only when the
window class is built, which used to sit outside the ImportError guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BYYHauLyja7Yb25MTzKeQ
…a already on disk

The View menu now has two entries. "Open Live Data Viewer" is the window
that was there before, following the acquisition being written.
"Open Acquired Dataset..." asks for a dataset on disk and shows it as it
is, with no timer and nothing followed: one tile store, one acquisition,
or a data folder of acquisitions (with the dropdown to switch between
them). Several can be open at once. The window title says which form a
window is.

The logic lives in watch.Opened, tested without Qt like the Follower.
Also fixed: reopening the live viewer after closing it brought back a
window whose viewer had been stopped; a fresh one is made now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BYYHauLyja7Yb25MTzKeQ
… per channel

An acquired dataset no longer has to be exactly (t, c, z, y, x). Any
in-order part of those axes that keeps z, y and x is read, such as
(z, y, x), (c, z, y, x) or (t, z, y, x); a missing axis counts as one
step long. A layer built from a store without a c axis pins no channel.

When a dataset holds one store per tile and channel, the channel each
store holds is taken from its own omero block, never from its file name.
Stores with the same label become one channel row, each reading only its
own stores. Without that metadata the stores cannot be told apart and are
shown as one channel.

OME-Zarr 0.6 is refused with a plain sentence: the neuroglancer release
the page is built on (2.41) does not read it. A store that is an image
but not one the viewer reads is now its own error (NotSupported), so it
is reported as such and never taken for a folder of acquisitions.

demo.write_store writes test stores in every accepted layout, on zarr v2
(0.4) and v3 (0.5); test_formats.py checks they are read, and that the
engine draws them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BYYHauLyja7Yb25MTzKeQ
OME_Zarr_Writer and MP_OME_Zarr_Writer save one (z, y, x) store per tile
and channel, with nothing inside the store saying which channel it holds.
Each store now carries an omero block with that one channel: the laser
line from the acquisition list as its label ("488") and the same false
colour the TCZYX writer uses. Written for OME-Zarr 0.4 (.zattrs) and 0.5
(zarr.json, under "ome").

The Data viewer reads it to show such a dataset with one row per channel,
without looking at file names. Data written before this has no omero
block and still opens, with its channels shown as one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BYYHauLyja7Yb25MTzKeQ
In the Data viewer window the depth (Z) slider was drawn lying flat, only
16 pixels wide, inside its upright box: the window's browser (Qt WebEngine,
Chromium 83) ignores the setting that turns a slider upright. It could hardly
be moved with the mouse. The slider now also asks that browser for its own
upright slider, with the first plane at the bottom as before; current
browsers draw it exactly as they did.

Only the page's stylesheet was rebuilt and swapped in; the rest of the built
page is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
Since the fast shard writer arrived in the OME-Zarr writer (d681289), its
pyramid writer looks up fast_writers for every chunk. The TCZYX writer sets
itself up without calling that writer's setup, so the attribute was
missing: every write failed in the writer processes and the stores held
only zeros.

The fast path writes whole shards without knowing which time point and
channel a stack belongs to, so the TCZYX writer does not use it: every
write goes through the stack windows, which put it in its place. Tested
with a demo acquisition from mesoSPIM, two time points, two channels and
two tiles, watched live in the Data viewer: every plane holds its data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
The fast shard writer compresses each shard's chunks in parallel and writes
the shard in one go, which is what lets the microscope save sharded,
compressed OME-Zarr at full camera speed. The TCZYX writer now uses it too,
so time-lapse and multi-channel acquisitions are written the same way.

A tczyx store holds one stack per time point and channel, so the shard
writer learns that an array may have leading axes before (z, y, x), each
shard one step deep along them, and writes each shard at the time point
and channel it is given. A tczyx array without that place is refused, and
anything the fast path does not cover (zarr v2, unsharded or uncompressed
stores, partial shards) still goes through zarr as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
The page build compiled neuroglancer's two background workers by writing over
their source stubs inside node_modules, and patched the engine there too. A
second build then compiled the already compiled workers and put the shims for
the Qt window's old Chromium into them twice, so no two builds were alike and
the committed page could not be made again from a clean install.

The build now leaves node_modules exactly as npm installed it. One small Vite
plugin (page_source/scripts/neuroglancer.mjs) compiles the workers from the
untouched stubs while the page is built and places both at the page's root,
and applies the transparent-ground edits to the engine's modules as they are
read. `npm run build` is now just `vite build`, and the page is rebuilt from a
clean `npm ci`.

A new test checks that each committed worker carries the old-browser shims
exactly once, and, where Node.js is installed, builds the page twice and
checks that both builds equal the committed page and that node_modules is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
In a layer with several tiles only the first tile looked right; the others
came out clearly dimmer, with smaller cells, and removing the first tile made
the next one the bright one. The engine draws each tile of a layer on its own.
It drew the very first one straight onto the empty picture and laid every
later one over it, multiplying the colour by the alpha. The channel program
carries a pixel's brightness in the alpha and had already multiplied the
colour by it, so every tile but the first showed the brightness squared, and
its dark edges counted as not imaged at all.

Now the channel program emits its colour at full strength with the brightness
in the alpha, as the engine expects, and one more build-time edit to the
engine lays the first tile over the empty picture the same way as the others.
Opaque layers look exactly as before. The 3D projections, which also multiply
by the alpha, are no longer squared either.

A new picture test draws a tile alone and as the second of four with the same
camera and compares the middle of it block by block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
The acquisition software's OME-Zarr writers put no display window into a
store's omero block, so the viewer started every channel on the whole
0..65535 range, where a camera's few thousand counts look nearly black until
the operator pressed Min-Max.

Now a channel left without a window, by the store and by the caller, gets one
measured from its data, as Min-Max would set it: the darkest and brightest
voxel of the coarsest copy in the store's pyramid, at the first time point,
through up to 16 planes. Voxels not written yet are left out, so in the live
window a tile the microscope has only just begun is measured again as data
lands, and a channel that arrives later is measured on its own. The window is
set once per channel and then left alone, so the picture keeps its brightness
while tiles land. A window in the store's metadata still wins. This applies
to the live window and to acquired datasets alike.

The sample is read with the zarr package mesoSPIM-control already installs;
without it the viewer starts on the full range as before.

Tests: a store without a window, a window in the store winning, a store
without data yet that gets its window once data lands and keeps it when a
brighter tile follows, and a channel arriving later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
The live view was fitted to the first tile of an acquisition and stayed
there, so later tiles landed outside the picture until the operator zoomed
out.

Now the page keeps framing everything shown, after every tile or time point
that lands, for as long as the operator has not panned or zoomed. Once they
have, the view is theirs and is left where they put it. Stepping through
depth or time does not count as moving the view. Asking for a fit again (the
2D/3D switch, or Viewer.fit(), which switching to another acquisition calls)
hands the view back to the page, and it follows again.

A new picture test adds tiles one by one: the view widens to take in the
second tile, stays put after the operator zooms with control and the mouse
wheel, and follows again after a fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
Found while fixing which time point a dataset opens on. Each plane and time
point is drawn over a span centred on its own number, but the sliders put the
view on the edge between a step and the next one, where the engine draws the
next. So "1 / 3" on the time slider showed the second time point, and every
plane of the depth slider showed the plane after the one it named; only the
last step looked right.

The sliders now put the view on the middle of the step they name, and read
back the step the engine actually draws.

A new picture test steps through every plane and time point of a store whose
voxels carry their own numbers, and checks that the picture shows the one the
sliders name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
An acquired dataset with several time points opened in the middle of its
run ("2 / 3"): the engine starts in the middle of every axis it does not
draw. The live window happened to open on the first time point only because
a run starts with one.

Now the page puts the time slider on the first time point whenever an
acquisition is shown for the first time, in both windows. After that the
time point is the operator's: tiles and time points landing in an
acquisition already shown leave it where it is, as the live window did
before.

A new picture test opens a three-time-point acquisition on "1 / 3", keeps
the operator's choice while another tile lands, and opens the next
acquisition on its first time point again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
In a window showing a data folder opened from disk, the dropdown called its
newest acquisition "(current)", though nothing is being acquired there, and
every such label carried a double space ("run_01  (current)").

The dropdown now knows whether its folder is being acquired into: the live
window marks the newest entry "(current)", with a single space, and a folder
opened from disk lists the acquisitions by name alone. Its tooltip says
"of this session" only in the live window.

Tests: the follower offers its list as live, a folder opened from disk does
not, and the page shows the labels accordingly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
In the Data viewer window (Qt WebEngine, Chromium 83) the "T" label sat under
the time slider's thumb at the first time point, and every slider was the
browser's plain grey. That browser knows no gaps in flex rows, so the label,
slider and reading of each slider touched, and it ignores accent-color.

The label and the reading are now kept apart from the slider by margins, and
the page draws every slider's track and thumb itself, in the panel's blue,
which looks the same in Chromium 83 and in current browsers. The upright
depth slider is now a level slider turned a quarter, first plane at the
bottom as before: Chromium 83's own upright slider cannot be dressed.

A new Qt test opens a three-time-point dataset in the real window and checks
that the time slider's label and reading stay clear of the slider. Also
corrects a comment in page.css that still named the old patch script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
With a second Qt window test, the suite crashed the Python process: the test
fixture made a QApplication per test, and Qt WebEngine cannot start again in
a process whose first QApplication has gone. The fixture now keeps one
QApplication for the whole session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
… window

The window mesoSPIM opens the viewer in draws the page with an older browser
engine that does not understand gaps between the items of a flex row or
column. The cards, each channel's colour dot and its name, and the contrast
buttons were therefore drawn touching. The spacing is now given by margins on
every item after the first, which every browser understands, so the panel
looks the same in the window as in a current browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
The names now say what each folder is: source/ is what a developer edits, and
build/ is what `npm run build` makes from it and what mesoSPIM serves. The
built page stays committed, so a microscope computer runs the viewer without
Node. The repository ignores every folder named build/, so one line in
.gitignore keeps this one; without it a rebuilt page would silently be left
out of a commit.

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

Copy link
Copy Markdown
Author

Hey,

I was happy to contribute.

I have fixed the PyQtWebEngine bugs as far as I could see. Please test it for me again.

You can now also use the viewer for any OME-Zarr dataset with 0.4 and 0.5, with ZYX and C and T in any combination. However, this does not scale well beyond a double-digit number of OME-Zarrs, so you get the most responsive feel and interaction with TCZYX. For this reason, I have pinned the live data viewer to TCZYX.

I did not add an option to drag and drop files into the viewer. Would you like that?

Anyway, we still need to polish a few things.

Let me know how it works now.

Looking forward to your response.

Thom

thomdehoog and others added 4 commits October 2, 2026 22:42
While nobody has panned or zoomed, the viewer keeps zooming out so that
every picture is on screen as more arrive. Once the operator moves the
view it stays where they put it; until now the only ways back were the
2D/3D switch or a fit asked for from Python. A Show all button now
appears beside the 2D/3D switch whenever the view is the operator's: it
frames everything at once and returns to following new pictures, and
disappears again because there is nothing left to bring back. Stepping
through planes or time points does not count as moving the view, and the
time point an acquisition opens on is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
The window for looking at acquired data now takes OME-Zarr folders
dragged onto it from the file manager, one or several at once: a single
tile, a whole acquisition, or a folder holding acquisitions (each of
them is added). Every folder is added to what is shown, never in its
place. Each tile sits where its own metadata puts it, channels of the
same name share one contrast row within an acquisition, time points join
the time slider, and while nobody has moved the view it zooms out to
show everything. A second acquisition with the name of one already
shown is numbered, so the two are never merged into one.

A folder the viewer cannot read does not stop the others: a sentence on
the picture says why it was not opened. Each acquisition's block in the
panel has a remove button that takes its pictures off the view.

The live window refuses drops and has no remove buttons, so what it
shows is always what the microscope is writing. Qt does not tell a web
page the paths of files dropped onto it, so the window takes the drop
itself and hands each folder to the same code that opens a dataset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
Three follow-ups to dropping datasets onto the window:

- A folder that could not be opened is now named in one short sentence,
  without its full path: "notes isn't an OME-Zarr folder the viewer can
  open." A store the viewer recognises but cannot show says why in a few
  words instead, for example "newer.ome.zarr can't be shown: it is
  OME-NGFF 0.6, which the viewer does not read yet."
- Removing the acquisition picked in the dropdown (a window opened on a
  folder of acquisitions) takes it out of the dropdown and shows the next
  one down, or the one above when it was the last, instead of leaving
  the view blank. The dropdown empties only when none remain.
- Picking an acquisition in the dropdown whose name a dropped one already
  shows numbers it, "run_a (2)", as a second drop does, so the two never
  merge into one block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oy1fuxHUwxG26gwjRtV4S
…etail reaches the finest copy

On the microscope the live viewer stayed black. Two causes, one behind the other:

- The watcher took a store that gained no file for three seconds as finished and never
  looked at it again. The writer creates the arrays when a stack starts and lands its
  first shard only after the camera's first 64 frames, so every store was forgotten
  before its first file. A store is now watched until it has been quiet for two minutes;
  the settle still completes the picture three seconds after the last file.
- The engine keeps what it read of a store for as long as the page lives, the chunks and
  shard indexes it found missing included, so even a re-read drew the empty store. A store
  read again is now given to the page under a new address (/data/<key>.<revision>/, the
  same folder), so it is read afresh; forgetStore in main.js is gone.

Along with it: the contrast is sampled from the coarsest copy that holds data yet, within
a cost cap, instead of waiting for the coarsest copy's last shard; the window polls off the
GUI thread; and the 3D Detail slider runs to 65536 ray steps (it stopped at 1024, so a
stack thousands of voxels across never drew from its finer copies).

Reproduced and verified with the real Live3DPyramidWriter writing a sharded OME-Zarr 0.5
store plane by plane; two regression tests added.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J2m2maCdWtVBtqdqaQi5xV
…is over

A time lapse marks every file name of the acquisition table with the time
point being acquired ('Sample_Time003.tif'). The marks stayed after the
time lapse had ended. An ordinary acquisition run next was saved under
'_Time003', and the OME-Zarr TCZYX writer placed it at time point 3 of
the store.

The marks now come off when the time lapse finishes or is cancelled. If
it is cancelled in the middle of a stack, they come off when that stack
has closed its files, because it still closes them under the name it has.

The mark is also found by a stricter rule: only '_Time' and digits at the
very end of the name, before the endings. A sample called 'Mouse_Time2h'
used to be cut to 'Mouse' by the first time point.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
… reader accepts

Three things about what the writers put into a store.

The MP_OME_Zarr_TCZYX_Writer stopped making smaller copies of a stack near
158 x 93 pixels. That smallest copy is what a viewer loads to show a whole
acquisition at once, and with a hundred tiles on screen it is far more
than each tile's few dozen pixels need. The copies now go on to about
40 x 24 pixels, which is sixty-four times fewer voxels for the overview
and adds well under a thousandth to the file. A store that is there
already keeps the number of copies it was made with.

Every channel entry now has a colour and a contrast. The OME-Zarr rules
ask for both, and programs that check a file refuse one without them. A
laser line without a colour of its own (a 473, a 532, a 594) gets one
from its wavelength, and a name without a number gets one by its place.
The contrast is written as the whole range of the data, which says that
nobody has chosen one. When a later stack adds a channel, the entries
the store already has are kept as they are.

The Data viewer reads a contrast over the whole range as 'none chosen'
and goes on setting the contrast itself. Its live preview is given the
colour the writer puts into the store, so the picture keeps its colour
when the preview gives way to the data on disk.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…g its tiles' folders

When a tile was first met, every one of its folders was listed, to learn
which files were there. For last week's acquisition all of that work
found nothing new, and on a network drive it took minutes: two hundred
tiles came to 26,800 folder listings here, and a real acquisition has
many times more folders than the test one.

A tile is now taken in as it is when three cheap signs agree. Its
description is more than ten minutes old. So is its newest file, which is
found by following the folders changed last, about six listings. And
every stack the store has room for ends in its last file, so nothing more
is expected to land. The same two hundred tiles take 1,200 listings. An
old tile that is not complete (a stopped run, or one still being copied
in) is listed and watched as before.

A tile taken in this way is checked by its description from then on, as
complete tiles already were. So that this also catches a stack acquired a
second time, which changes neither the store's shape nor its channels,
the MP_OME_Zarr_TCZYX_Writer notes each stack it begins in the store's
description ('mesospim_last_stack'). The viewer sees that one small file
change, lists the tile then, and names to the page only the files written
since.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…les on the same spot told apart

Two gaps in the map of positions.

An acquisition that is not on screen was known only by its tiles' names,
so one with more than a dozen positions had no map at all, only a line
saying how many there were. A tile's place is in its description, two
small files. They are now read with the looks that follow, in the time a
look has left once the tiles on screen have been seen to, and each tile
is read once. The map of a hundred-tile acquisition is there before it is
shown, and a click on a cell shows the acquisition and goes to the tile.

Tiles that lie on exactly the same spot (the same place acquired at
another angle, or lit from the other side) were drawn on top of each
other, and only the last could be pointed at or clicked. They are drawn
one inside the other: the first as the full tile, each further one a step
smaller.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
A histogram costs the graphics card a pass over the picture for every
tile in view, in every frame it is asked for. A channel on Auto asked for
one all the time, and so did every open channel row of the panel. While
the picture is being moved, zoomed or turned, nobody reads them: Auto
measures only once the picture has come to rest, and the panel's little
histogram cannot be read while it changes sixty times a second.

The engine is now asked for histograms only at rest. With a hundred tiles
of two channels in view, a frame of a drag no longer carries 202
histogram passes, and the page's own work per frame falls from 9.4 to
6.0 ms. A moment after the picture has come to rest it is drawn once more
with its histograms, and Auto measures that fresh one. In the volume
view, where Auto does not measure at all, a channel on Auto asks for
none.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…annel, not once a tile

In the volume view's Blend mode a tile is drawn straight into the
picture, so while the camera moves there was nothing to share. Once the
camera rests, though, the engine draws every tile a second time, to
learn what lies under the pointer, and after each one it copied that
buffer across the whole picture and cleared it. Every redraw at rest
paid for that, and there are many of them while data is still loading.

The second drawings of a channel's tiles are now left in the buffer
together, which keeps the brightest under each pixel just as the
separate copies did, and are copied once after the last tile. With 36
tiles of two channels a frame at rest has 8 whole-picture copies where
it had 78, and 84 clears where it had 154. The pictures are the same
pixel for pixel in Blend, maximum and minimum, and what the pointer
rests on is still found.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…s configuration

The page keeps up to 1 GB of image data on the graphics card and 2 GB in
the computer's memory, the engine's own limits, which suit any computer.
On one with a large graphics card that is less than it could use: a
large acquisition, above all as a volume, is drawn more coarsely than it
need be, because the engine has to let chunks go to stay within the
limit.

A 'data_viewer' section in the configuration file may now give both
limits in megabytes ('gpu_memory_MB', 'system_memory_MB'). Left out,
nothing changes. An entry that is not a positive number is left out with
a warning in the log, so a slip in the file does not keep the viewer
from opening.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…ace out again for each new one

Every tile that finishes loading adds its bounding box to the coordinate
space all layers share. The engine then worked out afresh how every tile
already there sits in that space: for the hundredth tile ninety-nine
times over, and so on for each one after it. Opening 196 tiles of two
channels spent 2.6 of its 9.5 seconds of processor time on this alone,
and most of the tasks that held the page up for more than 50 ms came
from it.

How a tile sits in the shared space depends only on the names and scales
of the axes, the extent of the channel axis, and the tile's own
transform. A new tile's bounding box changes none of them. The build now
has the engine keep the result and work it out again only when one of
those has changed. The same opening spends 1.5 s where it spent 4.5 s
adding tiles to the shared space, and the tasks over 50 ms fall from 12
to 6.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…scope PC

The Data viewer page now describes the map of an acquisition that is not
shown and tiles drawn one inside the other, and has a section on giving
the viewer more memory through the configuration file. The format page
says what the TCZYX writer puts into a store now: a colour and a
contrast for every channel, smaller copies down to about 40 x 24 pixels,
and the note of each stack begun. The viewer's README explains how old
acquisitions are taken in without listing their folders, and the two
further engine changes for many tiles.

The list of checks for the microscope PC gains four: the map of an
acquisition before it is shown, the file names after a time lapse, a
writer process ended on purpose, and the same time point acquired a
second time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
In a time lapse every tile's store grows by a time point, again and
again. The page has to read such a store afresh, under a new address,
and it gave that address to the source that was on screen. That emptied
the source at once: the tile went black for about 460 ms and came back
when its chunks had loaded again, once per tile and time point. Anyone
looking at an earlier time point while a time lapse runs saw it.

The reading that is on screen now stays, under a name of its own, beside
a new source for the new address. It is marked as on its way out from
the start, and the page lets it go when the new one's picture is up, the
way it already does for a live preview that the tile on disk takes over
from. Measured the same way as before: no frame with less than the full
picture.

Found by comparing with the ZMART viewer, which keeps a grown store's
picture through an edit to the engine. This does it with what the page
already had. The chunks on screen are still fetched a second time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The MP_OME_Zarr_Writer now makes its smaller copies down to about
40 x 24 pixels, as the TCZYX writer does. It stopped near 158 x 93,
which is far more than a tile needs when a hundred of them are on
screen.

A tile taken in as finished long ago is asked once more, fifteen
seconds later by this computer's own clock, whether its newest file is
still the same one. Whether a tile is old is read from its files'
times, and a computer whose clock runs behind writes files that look
old. A tile being written over by such a computer is now found out and
watched.

Two tests no longer depend on how busy the computer is. The test that
follows a run by the real writer checks everything every time, and
repeats the run once before it fails for the picture having come late.
The frame test for moving and zooming waits until the whole picture is
there before it measures it. A third test asserted nothing, because the
path it filtered by never matched; it now does what it says.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The page reads OME-Zarr and nothing else. A run saved with the TIFF, raw
or BigDataViewer HDF5 writer could be watched while it was acquired, from
the camera's frames, but not opened again afterwards. Many laboratories
save in one of these formats every day.

Nothing is converted and nothing is written. A stack in such a file is
given a description as an OME-Zarr store, made in memory, and when the
page asks for a piece of the picture the bytes are cut out of the file
then and there. The smaller copies a view of a whole acquisition needs
are made by taking every second voxel, every fourth, and so on. Where a
stack lies and which channel it is comes from the _meta.txt beside a
TIFF or raw file and from the .xml beside an HDF5 file.

Such a run is opened with Open (any one of its files), by dropping a
file on the window, or from the list of the data folder. The TIFF or raw
files of one run are told by what their names share; an HDF5 file is a
run by itself. A run the microscope is acquiring in one of these formats
is shown from the camera's frames as before, and from its files, at full
size, once it is over.

Tested with files written by mesoSPIM's own TIFF, raw and HDF5 writers.
An overview of many large tiles is slower than from OME-Zarr, most of all
for HDF5, where whole blocks are read to take a few voxels out of each.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
… out

With every tile of a large acquisition in view, each is a source of its
own that the engine sets up, loads and draws for. The earlier changes
made that work small for each tile; it still grew with their number.

A finished acquisition of twelve tiles or more is now given one small
picture of the whole, about a screenful across. Python puts it together
in memory from each tile's own smaller copies, each placed where the
tile lies, keeping the brighter voxel where two overlap, and adds it to
each channel's layer as one more source. Nothing is written to disk.

Five edits to the engine let that source stand in for the tiles. Every
source carries a rule: the overview is left out while the screen asks
for finer than it has, and a tile is left out while the screen asks for
nothing finer than the overview. Left out means neither drawn nor
loaded, and the choice is made where the engine picks which copy of a
source to use, in code its page and its background worker share. A
tile's rule is switched on only once the overview's picture is on
screen, so the picture is never empty while it loads.

Measured with 36 tiles in two channels, zoomed out: a frame of the flat
view takes 11 buffer switches where it took 151, and the page's own time
per frame falls from 4.5 to 0.9 ms; a frame of the volume view takes 8
chunk draws where it took 3456. The picture is the same to the eye (26
of 432,000 pixels differ). Zoomed in, the picture and its cost are those
of the tiles alone, pixel for pixel.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The automatic tests draw in a browser the test tool brings along, and
everything else on the list of checks for the microscope PC was done by
hand. Nothing from the last days has run on Windows at all.

This script opens the Data viewer window itself, as mesoSPIM does, on
the PC's own screen and graphics card, and goes through what an operator
would: a saved acquisition, data from the microscope's writer with and
without shards, a run followed live and handed over to disk, a time
lapse, 2D and 3D, the map, a large acquisition with its overview, runs
saved as TIFF and HDF5, resizing and closing. Each step is reported as
PASS or FAIL with what was seen. It also measures how long a frame takes
while the picture is panned, zoomed and turned, and reads what the
graphics card and the computer have, to suggest memory settings. The
defaults stay as they are; whether to raise them is decided on the PC.

It needs no microscope and does not start mesoSPIM, so three checks stay
on the list by hand: the writer's page in the wizard, rows run one at a
time, and the file names after a time lapse. Two checks are added to
that list: a run saved as TIFF or HDF5, and whether neighbouring tiles
of real data line up.

Run here in the real Qt window under a virtual display: 11 of 11 steps
passed. The frame times measured here mean nothing, without a graphics
card.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The README said nothing of the ZMART viewer's composed picture was
needed for a view of at most a few dozen stores. Acquisitions of a
hundred tiles showed otherwise, and the overview picture is the answer.
It says so now, and where the idea came from.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
… without a graphics card

One of its four sessions spends its first minutes in the volume view,
zoomed in on a large picture. Without a graphics card a frame of that
takes a minute, and whether the session's 55 clicks fitted into the time
allowed depended on how busy the computer was. Today it did not, at
yesterday's state of the code as well.

When the page has become that slow, the session now goes back to the
flat picture, and it stops clicking when its time is nearly up. On a
computer with a graphics card neither happens and all 55 clicks are
made.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
In a time lapse every tile's store grows by one time point, again and
again. Until now the page read such a store afresh each time: with nine
tiles on the picture that was about 290 chunk files, 300 MB, for every
time point, although nothing that was on the screen had changed.

The page is now told from the start that a store has room for more time
points than it holds (64 to begin with, and more when a run needs it).
A time point more then changes nothing the page has to read again: the
store keeps its address, and the page is only told how many time points
are real, so that the time slider ends where the data ends.

Two things keep the extra room from costing anything. The engine looks
ahead along time while you play through a time lapse, and it is now
told not to look past the last real time point. And the view goes to
the first time point the moment the picture gets a time axis, instead
of starting in the middle of the room and loading a screenful there.

A stack that makes a store deeper still gets a new address, as before,
and keeps its picture while it is read again.

Measured here with nine tiles: the first picture asks for 293 chunk
files, all of the first time point, and a time point more on all nine
tiles asks for none again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
…once

A writer that falls behind can still be saving one channel when the
microscope is well into the next one. The viewer stops waiting for the
first channel after a minute and a half and shows what there is of it.
Files of that channel that landed after that could take ten seconds to
reach the picture, because a tile whose next stack is on screen from
the camera's frames is looked at on disk only now and then.

For two minutes after a stack was shown with files still missing, its
tile is now looked at every second, so a late file is on the picture
within about a second.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The viewer kept at most 1 GB of image data on the graphics card and
2 GB in the computer's memory, on every computer, unless the
configuration file said otherwise. Few configurations do, so a
microscope PC with a large graphics card drew large acquisitions
coarser than it could, and loaded parts of the picture again that it
could have kept.

When nothing is set, the viewer now looks at what the computer has and
takes a modest share: half of the graphics card, at most 4000 MB, and
an eighth of the computer's memory, at most 8000 MB. A computer can
have two graphics cards, so the page says which one it is drawn on and
only that card counts. Whenever something cannot be found out, the old
limits stay. The log says what was chosen, and the configuration file
still overrides either number.

The documentation also explains how an HDF5 run gets a quick view from
far away: the writer can be told to save smaller copies (subsamp), and
the viewer reads from them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The engine counts image data that is on the graphics card against the
limit for the computer's memory as well. A share of the card larger
than half of that limit could never be filled, and would leave no room
for the parts of the picture that were drawn a moment ago. When the
viewer chooses the card's limit itself it now keeps to that proportion,
which is the one the engine's own limits have (1000 MB and 2000 MB).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
The test that lets the page name its graphics card gave the viewer the
engine's small limit for the computer's memory. Since the card's share
is held to half of that limit, the test now gives the viewer 8000 MB of
memory, so that the share it expects can be granted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
Upstream has moved on by thirteen commits: a Help menu, the beam
profile tool, the ASLM scan simulator, a check for file paths that are
too long for Windows, and shorter names for the OME-Zarr writer's
temporary and side files.

Three files needed a decision by hand (the change log, the user guide
and the writer's import line); in each both sides are kept.

One thing had to be added for the two to work together. The new check
asks each writer how long its longest file path gets. The TCZYX writer
is built on the MP writer and so inherited its answer, which looks up a
write cache setting the TCZYX writer does not have. On Windows that
would have stopped every acquisition with this writer before it began.
The TCZYX writer now answers for its own layout: a tile's store has no
channel in its name, and its chunk files lie two folders deeper, one
for the time point and one for the channel. Its side files are named as
upstream now names the other writer's, without the two '.ome.zarr'
endings, and the zoom in a tile's name keeps its last character.

The viewer already passes over files that end in '.tmp', which is what
zarr's temporary files are now called.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
Everything in this branch was built and tested on Linux, without a
graphics card. WINDOWS_CHECK.md, beside the viewer's tests, is one page
for the part that needs the Windows PC of the microscope: what to
bring, the four parts of the check, which of them matter most, and a
prompt for an AI coding assistant on that PC that runs the tests and
guides the operator through the checks by hand.

The documented checks gain one, number 18: an acquisition whose folder
has a very long name. mesoSPIM's new check for paths too long for
Windows only runs on Windows, so the TCZYX writer's part in it has not
run for real yet.

The two reports these checks write are kept out of git.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oYxQDJ2ipahHghK29MpVm
nvladimus added a commit that referenced this pull request Dec 1, 2026
Utils -> ASLM scan simulator now loads the page in a QWebEngineView
window instead of the OS default browser, which on some PCs is
Internet Explorer and breaks the page. Falls back to the default
browser when PyQtWebEngine is not installed.

- PyQtWebEngine==5.15.7 added to requirements-conda-mamba.txt and
  pyproject.toml, at the same lines as PR #117 (Data viewer), so the
  two merge without conflicts.
- mesoSPIM_Control.py sets AA_ShareOpenGLContexts and imports
  QtWebEngineWidgets before QApplication exists, as Qt requires.
  Duplicates PR #117's prepare_qt(); drop it once #117 is merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thomdehoog and others added 6 commits December 2, 2026 13:58
4c198d8 moved the tile naming, with `laser = ...`, out of open() into a
helper, but open() still hands `laser` to the writer process as the
channel's name and colour. Every acquisition saved with
MP_OME_Zarr_Writer stopped at its first stack with
NameError: name 'laser' is not defined. Found on the microscope PC in
demo mode; the TCZYX writer has its own open() and was not affected.

No test opened this writer, so test_omezarr_mp_writer.py now writes one
stack through open(), write_frame() and finalize() and reads back the
data and the channel's name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- watch.py timed a look with time.monotonic(), which on Windows moves
  only every ~15 ms. A short look measured 0 s, so its budget was never
  exceeded and every place was read at once. time.perf_counter() is
  exact on Windows too
  (test_library::test_places_are_read_in_the_time_a_look_has_left).
- test_overview checked for paths ending in "/1"; on Windows they end in
  "\1". It now compares the last part of the path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
During a time lapse the acquisition's name is 'Sample.ome_Time003.zarr'.
The metadata text and the maximum projection beside the data took their
name from it after cutting off '.ome.zarr', which a marked name does not
end in, so they were called 'Sample.ome_Time003.zarr_Mag1_Tile0_..._meta.txt'.
Seen on the microscope PC in a time lapse with the TCZYX writer; the
MP_OME_Zarr_Writer names them the same way.

Both now use acquisition_stem(): the name without '.ome.zarr', with the
time mark after it ('Sample_Time003'), so every time point keeps files
of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s memory figure

Three small things from checking the Data viewer on the microscope PC:

- After Stop, the writers still save what was acquired. For a large
  OME-Zarr stack that took 13-19 s with nothing on the status line, which
  looked like a hang. Core.stop() now says 'Stopped: saving what was
  acquired so far...' while an acquisition is stopped.
- A list refused because the writer's paths would be too long for
  Windows was only shown in a message box. It is now in the log as well,
  as the refusal for the stage limits already was.
- The rehearsal read the viewer's memory limits in its first check,
  before the page had said which graphics card it draws on, so it
  reported the page's own 1000 MB where mesoSPIM keeps 4000 MB. It now
  reads them again in its last check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two conflicts, both kept from each side: .gitignore (the Data viewer's
build and report rules, and .claude/launch.json) and CHANGELOG.md (the
TCZYX writer's entry and the webcam window's). The changelog also notes
the side-file names of a time point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the microscope PC, a 25x acquisition saved with chunks of 240 MB
(64 x 1264 x 1480, sharded) was opened, set to the highest Detail in 3D
and zoomed in. The window went blank, panel and all, without a word in
the log: the process that draws the page had been ended.

Reproduced outside mesoSPIM: after the zoom the page's process grew from
2 GB to 16 GB in twenty seconds and ended. The engine's memory limits
count a chunk only once it has arrived, and eight were fetched at once,
each held several times over while it is read, decoded and handed on.

- The page fetches fewer chunks at once where the chunks are large: the
  decoded chunks in flight stay under 250 MB together, so one at a time
  for this dataset and eight, as before, for ordinary ones. The same
  steps then peak at 11 GB and the page lives.
- If the page's process ends all the same, the window starts the page
  again, with what was shown, says so on the picture and writes it to
  the log. After three times in two minutes it stops trying and says so.

The new window test ends the page's process and waits for the page to
come back with its acquisition and the message.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants