FLIMKit

Plugins / FLIMKit / Z stack Explorer · edit on GitHub

Z-stack Explorer

flimkit-zstack-explorer takes a z-stack loaded in FLIMKit, stacks its per-slice intensity and lifetime maps into two volumes, saves them as one OME-Zarr store, and opens a 3D viewer with the two side by side.

Installing the explorer

pip install 'flimkit-zstack-explorer[gui]'

Quote it: in zsh, the macOS default shell, an unquoted [gui] is a glob and the command fails with "no matches found". [gui] adds PyVista, which draws the 3D view. Without it the volume is still built and saved, and the viewer step tells you what is missing. Check the install from the terminal you start FLIMKit from:

python -c "import flimkit_zstack_explorer, pyvista; print('ok')"

Using the explorer

  1. Load a z-stack in Single FOV Fit with Analysis set to Z-stack, and fit it, or pick a Z row in a project folder that already has a fit (Step 14).
  2. Tools > 3D Z-stack Explorer... asks where to save the store (zstack_volume.zarr by default) and opens the viewer when it is written. A store already at that path is overwritten.

3D Z-stack Explorer

This is the Series008 stack, 8 slices. Intensity is on the left and lifetime on the right, and the two cameras are linked, so dragging either rotates both. Scrolling zooms.

The volumes are built from the preview panel's own display code, the same path the z-slider uses, so each slice matches what the 2D view shows for it.

Tools > Open Saved 3D Volume... reopens a .zarr store from an earlier run without a z-stack loaded. Outside FLIMKit:

python -m flimkit_zstack_explorer.viewer --zarr zstack_volume.zarr

The store has two channels, intensity and lifetime in ns (NaN where a slice had no per-pixel fit), so it also opens in anything else that reads OME-Zarr.

The viewer runs as its own process. FLIMKit's window is Tk and PyVista's is VTK, and on macOS both expect to own the main thread, so they are kept apart.