Skip to content

Microscope Double-Pass tissue segmentation ​

Native Python user-facing Double-Pass tissue segmentation. This is separate from browser contribution/census implementations.

This is an ordinary microscope-node.toml extension. The companion loads it through the public node-pack discovery and package-isolated execution path; no official-only runtime is used. Node IDs are namespaced under microscope_doublepass. Historical microscope.* IDs remain supported by schema-declared legacy_ids when this pack is installed.

Install locally ​

Review the source, install the scientific dependencies into a package-specific interpreter, then register the local checkout explicitly:

sh
python3 -m venv .venv
.venv/bin/python -m pip install -e .
microscope nodes register /absolute/path/to/microscope-nodes-doublepass --python /absolute/path/to/microscope-nodes-doublepass/.venv/bin/python --trust

This installs NumPy and headless OpenCV from this pack's declared dependencies. Registration is explicit local trust. The SDK injects the framework into the isolated node process; installed package environments do not share Python site-packages.

Development and tests ​

sh
python -m pip install -e .
python -m unittest discover -s tests -v

No environment or model weights are committed. Model weights must be obtained by the user from the official source, stored locally, and pass the pinned SHA-256 check.

Attribution ​

This package's implementation is Microscope.io source code. It depends on NumPy (BSD-3-Clause) and OpenCV (Apache-2.0 Python distribution; OpenCV project components retain their upstream BSD notices). See NumPy licenses and OpenCV licenses. Model-specific attribution and source licenses are documented in the respective model README.

This is the user-facing native Python workflow algorithm. It does not alter browser-internal contribution Double-Pass, community sampling, or frozen censusRecipeV1. Default parameters and operation order are preserved from the former built-in node.

Use the node ​

Double-Pass is an overview-scoped tissue-mask heuristic. Its stable type ID is microscope_doublepass.double_pass; it accepts an RGB image and returns a binary mask. The node declares a target working resolution of 10 µm/px, so connect it to WSI Region in overview scope at 10 MPP. The viewer resamples from the opened slide using measured X/Y MPP; it does not process every level-0 pixel.

Parameters are:

ParameterDefaultRangeEffect
gray_tolerance150–60Minimum RGB channel spread used to select color pixels in the first pass.
min_component_pixels50000–100000Minimum component area at the node's working grid.

To run it, install/register this pack, start and pair the local Python companion, then add WSI Region and Double-Pass in the viewer's Workflow editor. Select overview/10 MPP on the source, connect image to image, adjust the parameters, and choose Run. Add its mask output to Layers for local overlay inspection. The packaged workflows/doublepass_mask.json is a static editable composite definition and is available from the node library when the pack is registered.

This uses NumPy and headless OpenCV. It needs no learned model or model weights. Install into an isolated pack environment and register the exact interpreter as shown in the installation section. A pack is trusted executable Python, not a sandbox. If the node is unavailable, restart the companion after registration and reconnect the viewer.

Double-Pass is a research segmentation heuristic. A tissue mask can include debris, pen marks, folds, or background variation; inspect the result and tune settings for the slide/scanner. It is not clinically validated and must not be interpreted as a diagnosis or validated measurement. An overview mask is coarse and should be treated as a navigation/gating result, not a high-resolution boundary.

The generated node schema is authoritative for the current port, bounds, defaults, and overview execution requirement. The package tests run without model assets:

sh
python -m pip install -e .
python -m unittest discover -s tests -v