Skip to content

How To Use

Aditya edited this page Jul 5, 2026 · 1 revision

How to Use BoutonViewer

This page walks through every control in the "Bouton Analysis" dock panel, what it does under the hood, and why it's built the way it is. For install/ setup steps, see the main README. For what the model was trained on and its data assumptions, see Model & Data Notes.

Image section

Acquisition type dropdownLSM or Airyscan. This picks which preprocessing pipeline runs (see Model & Data Notes §3 for the full technical breakdown):

  • LSM: rolling-ball background subtraction, then percentile normalisation, then (optionally) Richardson-Lucy deconvolution.
  • Airyscan: percentile normalisation only — no background subtraction or deconvolution, since Airyscan acquisition already applies its own computational deconvolution on-instrument.

Both paths resize the image's XY dimensions to 1100×1100 px first — upscaling or downscaling as needed, a no-op if it's already that size. This matters because the rolling-ball radius, the deconvolution PSF sigmas, and the model itself were all tuned at that scale; the final segmentation labels are resized back to your image's original dimensions before any volume/surface-area stat is computed, so this internal resize never affects the physical units reported.

If you loaded an image and realize you picked the wrong type, you don't need to reload it — just change the dropdown. The app reclassifies the already-loaded image in place: voxel size is recomputed and the display rescales immediately.

Apply RL deconvolution checkbox — checked by default. Controls whether the Richardson-Lucy deconvolution step of the LSM pipeline runs. Unchecking it gives a faster, lighter LSM run (background subtraction and normalisation still happen, just not deconvolution) — useful if deconvolution is over-sharpening artefacts on your data, or you just want a quicker look. This has no effect when Airyscan is selected (the checkbox is greyed out), since that path never deconvolves.

Importantly, this toggle is completely independent of the MicroSAM model variant you pick further down. Earlier versions of the app tied deconvolution to the model choice — selecting the "Base" variant used to silently switch LSM images to the deconvolution-free path. That coupling has been removed: you can now run Base+deconvolution, Base+no- deconvolution, Large+deconvolution, or Large+no-deconvolution, in any combination.

Load TIFF… button — opens a file picker for .tif/.tiff stacks. Supported layouts: 3D single-channel (Z, Y, X), or 4D two-channel stacks in either (Z, C, Y, X) or (C, Z, Y, X) order — the loader infers which from the shape. Each channel appears as its own napari Image layer (green/red for a 2-channel stack, a single grayscale layer for a single-channel one).

Voxel size (µm) section

Three spin boxes (Z, Y, X) holding the physical size of one voxel in micrometres — this is what all volume (µm³) and surface area (µm²) calculations are based on. They auto-fill when you load an image:

  • LSM always gets the fixed confocal pitch (0.3, 0.0709, 0.0709).
  • Airyscan is auto-detected from the image's actual native dimensions: larger than 1100 px gets the finer super-resolution pitch (0.3, 0.0425, 0.0425); at or below 1100 px gets the LSM-matching pitch.

You can edit any field directly if you know your own acquisition's calibration differs from these defaults (see Model & Data Notes §2 for why these particular numbers aren't universal constants). Editing after a prediction has already run recomputes the displayed stats and rescales the 3D display a short moment after you stop typing/clicking — no need to re-run Predict.

MicroSAM Checkpoint section

Checkpoint path field + "…" browse button — point this at your best.pt file (see the main README for where to download checkpoints).

Model variant dropdownLarge (vit_l_lm) or Base (vit_b_lm). This only affects inference (speed vs. quality trade-off), not preprocessing — see the deconvolution note above. It's read only at the moment you click Predict, so it's safe to change beforehand without side effects.

Run Prediction

Click ▶ Run Prediction. This runs in a background thread so the UI stays responsive; a progress bar and status line report each stage (preprocessing, RGB conversion, per-slice segmentation, 3D linking, resizing back to native resolution). When it finishes, a "boutons" Labels layer is added to the napari viewer and the stats table fills in.

Caching: re-running Predict on the same loaded image with the same image type and deconvolution setting skips preprocessing entirely and reuses the cached result — only inference reruns, so flipping between Large and Base alone is fast. Changing the image type, toggling deconvolution, or loading a new image invalidates that cache automatically and forces a full re-preprocess on the next Predict.

Inspecting results

  • Hover over a bouton in the 3D or 2D view to see its ID, volume, and surface area in the info box.
  • Click a bouton to highlight its row in the stats table (and vice versa via the table's own selection).
  • The table lists every detected bouton with volume (µm³) and surface area (µm²); click a column header to sort by it.
  • Total boutons above the table shows a live count that updates as boutons are deleted.

Exporting results

Export CSV… button — enabled once at least one bouton has been detected. Opens a save dialog; the resulting file uses German-locale conventions: ; as the field separator and , as the decimal separator (since standard ,/. conventions collide with German number formatting), written as UTF-8 with a BOM so the µm³/µm² unit suffixes and the file itself open correctly in German-locale Excel/Calc without a manual import wizard.

Deleting a bouton

Select a row in the table (or click a bouton in the viewer), then click Delete Selected Bouton. A confirmation dialog appears first — once confirmed, the label is zeroed out of the underlying array and removed from the table. This cannot be undone; the only way back is to re-run Predict.

Note that the app has no automatic upper size limit on detected boutons by design — an implausibly large label usually means the model merged two adjacent boutons rather than a single very large one, and it's left to you to spot and delete it manually rather than have the app guess and silently discard real data. See Model & Data Notes §4 for the full reasoning.

Clone this wiki locally