Repository navigation
Description
Goal
Deliver the first executable, end-to-end QuPath-to-MorphoBricks pilot on one small ROI. Reuse the existing generic LabConstrictor worker/manifest bridge; do not build a QuPath-specific feature extractor or wait for WSI streaming.
QuPath 0.7 selected annotation / viewport -> current bridge TIFF + optional RegionOf mask -> registered Python tool -> morphobricks-normalization RGB-to-YX scalar -> existing FiberFeatures API -> table + image outputs -> QuPath results window.
This is a small-ROI smoke test only. Attaching measurements to existing QuPath objects and large-slide file-based results binding are later bridge work; the pilot must still leave a useful reproducible results bundle.
Code-grounded starting point
- LabConstrictor–QuPath README: registered apps/tools via JSON-lines worker, selected-annotation/current-viewport image areas, TIFF export, results table/images/points/shapes. QuPath supports the
folderandfileinput types too. - Groovy bridge implementation:
LcAreaandprepareImageInputfreeze/crop the selected plane/area and refuse inputs over 100M px / 4 GiB,addResultdisplays feature tables and image previews. - Selected annotation(s) currently exports a BOUNDING RECTANGLE, not the true polygon unless the tool also requests a
RegionOfannotation mask. Do not infer from bounding-box pixels that all are collagen/ROI interior. - LabConstrictor-Tools protocol supports
image,labels,tableandfileoutputs; use its existing declarations andhosts: [qupath]registration as appropriate. - Conversion implementation owner: morphobricks-normalization #94, not the bridge or FiberFeatures.
- FiberFeatures pilot & validation: fiberfeatures #210; first outputs from unchanged
run_fiberfeatures_pipeline.
Minimal steps (do in this order)
- Register one small LabConstrictor-compatible Python demonstration tool (app ownership/packaging to agree) with declared RGB image input, optionally the exact selected-ROI mask, explicit stain profile/method choice, and calibrated pixel-size parameters when available. It should be discoverable under QuPath without any new hard-coded app name in the bridge.
- Open a known 8-bit sRGB Masson's blue-trichrome crop/slide, select exactly one annotated ROI, run using Image area: Selected annotation(s). Confirm source file/series, z/t plane, region origin, actual RGB channel order/axes, real colour data (not QuPath display LUT), saved crop dimensions and physical calibration. An ambiguous RGB image type or unknown required calibration must be refused, not guessed.
- If the ROI is nonrectangular, pass its actual mask via the existing region-mask mechanism and validate mask/image alignment. Do not pretend the crop bounding box equals the ROI.
- Call the normalization-owned
rgb_to_scalaroptions (initially luminance, signed CIELAB blue,bpxmethyl-blue stain component), then unchanged FiberFeatures 2D core with identical physical scales/configuration and a common ROI. - Return a small table of measurements (including method, ROI/source identity, applicability/NaN reasons) and image outputs for scalar map, ridge support and orientation/coherence. Confirm the bridge opens table and previews, and keeps a run manifest with exact revisions, geometry, source colour/profile, calibration and conversion method.
- Run a noncollagen / nucleus-rich control on the same slide. Conclude pass/fail for correct plumbing and structural specificity, not clinical/SHG validation.
What to verify adversarially
- QuPath RGB serialization: the 3 RGB samples must remain one RGB imaging unit, not three independent fluorescence channels, nor a
(Y,X,3)pseudo-3D volume; confirm the actual exported TIFF array and declared axes (QuPath file import and Python reader may disagree on channel ordering). - True, consistent ROI support in all three conversion comparisons;
RegionOfmust be on the same z/t as the exported RGB. - Known
dy,dx(or explicitly pixel-only analysis); do not use the QuPath bridge's single square-pixel field to silently replace non-square calibration. - Existing FiberFeatures
preprocess_imageinternally percentiles each scalar image: do not interpret derived output as absolute stain concentration. - Freeze ROI and target image at run start; changing slide/selection during a delayed worker run cannot rebind the outputs (existing fixes for QuPath #16, #21).
- No unnecessary full-slide export and no modifications to arbitrary installed image files or QuPath annotations for this P0.
Acceptance
- A developer can run a documented QuPath 0.7 GUI fixture (small RGB slide + one ROI), producing a real feature table and preview, through an installed/registered tool with no manual Python subprocess invocation.
- Recorded TIFF/mask pixel and ROI coordinate tests, RGB channel/axes assertions, and source-calibration provenance. Failed inputs give explicit refusal messages.
- Runs without CellPatcher's still-planned WSI lazy readers, without changing the FiberFeatures measurement implementation, and without assuming new QuPath measurement-attachment support.
- Independent end-to-end smoke test executed (distinguish CI automation from human GUI testing). Include OS/QuPath version and whether verified on that platform.
Not in scope: WSI/Ome-Zarr lazy tile orchestration, automatic attachment to existing ROIs, large spatial heatmap overlays, colour tensor/new ridge features.
Activity