Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/qupath-gui.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: qupath-gui
# The GUI tests (tests/gui_test_*body.groovy) in a real QuPath 0.7 on a virtual screen (Xvfb), the same way tests/run_gui_test.sh runs
# them locally: the extension jar built from this repo is put on QuPath's class path and each body is run as QuPath's test script.
# tests/run_gui_ci.sh runs every body, keeps a log per body and fails when any body fails. See README, "Build and test".
# tests/run_gui_ci.sh runs every body, keeps a log per body and fails when any body fails. See docs/REFERENCE.md, "GUI tests in CI".
on:
pull_request:
workflow_dispatch:
Expand Down
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Notes for agents and contributors

LabConstrictor-QuPath is the QuPath 0.7 extension that runs the tools of installed LabConstrictor apps. How to build it and run the tests: [technical reference](docs/REFERENCE.md#build-from-source-and-test).

## Documentation

Each topic of the LabConstrictor ecosystem has exactly one owner page, and every other page links to it instead of copying it. The table of owners is in "Sources of truth" in [LabConstrictor-Site's AGENTS.md](https://github.com/CellMigrationLab/LabConstrictor-Site/blob/main/AGENTS.md).

- This repository owns the **QuPath guide**, `docs/user-guide.md`: what you need, the install steps, the menu path, the current version and the common problems. The site publishes it at <https://cellmigrationlab.github.io/LabConstrictor-Site/guides/qupath/>, so every link and picture in it must be an absolute address.
- `README.md` is a landing page: it gives one install line and links to the guide. It names no version of the extension.
- `docs/REFERENCE.md` holds the technical rules, the build and the tests. It links to the guide for installing and using the extension.
- When a release changes the current version, update it in `docs/user-guide.md` only.
- Write as the site does ([LabConstrictor-Site's DESIGN.md](https://github.com/CellMigrationLab/LabConstrictor-Site/blob/main/DESIGN.md)): sentence case, plain words, and link text that says where it goes.
237 changes: 30 additions & 207 deletions README.md

Large diffs are not rendered by default.

218 changes: 218 additions & 0 deletions docs/REFERENCE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/UI_AUDIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A driver that presses every control of the LabConstrictor window in QuPath, open
| `LC_UI_RUN_VIA` | `click` (default) or `call` (`dlg.run()` is called instead of a mouse click on Run; diagnostic) |
| `LC_UI_SEED` | negative controls only |

The harness modifies the QuPath installation (README): `tests/run_gui_test.sh` copies the jar to `lib/app/labconstrictor-qupath-0.1.0.jar`, edits `lib/app/QuPath.cfg` and keeps the first copy of it as `QuPath.cfg.before_lc_tests`. To restore: move that file back and delete the jar.
The harness modifies the QuPath installation ([technical reference](REFERENCE.md#build-from-source-and-test)): `tests/run_gui_test.sh` copies the jar to `lib/app/labconstrictor-qupath-0.1.0.jar`, edits `lib/app/QuPath.cfg` and keeps the first copy of it as `QuPath.cfg.before_lc_tests`. To restore: move that file back and delete the jar.

## How it works
* **One QuPath launch per phase and per tool** (`panel`, `panel_run`, one `tool` launch per tool) on a COPY of `lc_tests` (a tool that writes into the fixtures cannot spoil the next launch), each under `timeout`. A launch that hangs or crashes becomes FAIL rows for every id of its phase, and the next launch starts. A run that exceeds `LC_UI_TOOL_TIMEOUT` is cancelled, the worker killed and the row is FAIL.
Expand Down
Binary file added docs/img/qupath-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/qupath-stardist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/labconstrictor-project.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yaml-language-server: $schema=https://labconstrictor.cellmig.org/schema/labconstrictor-project.schema.json
# yaml-language-server: $schema=https://cellmigrationlab.github.io/LabConstrictor-Site/schema/labconstrictor-project.schema.json
# How this project is listed on the LabConstrictor website's Ecosystem page. Keep the status true.
name: QuPath
summary: 'Extensions > LabConstrictor tools for QuPath 0.7: pick an app and a tool and get a form generated from the tool''s declaration.'
summary: 'Run the tools of your LabConstrictor apps in QuPath 0.7: pick an app and a tool and get a form generated from the tool''s declaration.'
status: Experimental
67 changes: 41 additions & 26 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,60 @@
# Install the QuPath extension

The extension runs the tools of every installed LabConstrictor app from QuPath, with a form generated from each tool's declaration.
Run the tools of your LabConstrictor apps from QuPath: one window lists every installed app, you pick a tool and press Run, and outlines and points come back as annotations on your image.

> [!WARNING]
> **Under heavy construction.** This plugin is untested and unlikely to be stable. Expect bugs, missing features and changes without notice. Do not rely on it for work you cannot redo.
>
> For QuPath 0.7 (tested with 0.7.0 on Linux; Windows and macOS get informative checks in the release run, not tested by a person). The jar is attached to each release.
> **Experimental.** This extension is an alpha pre-release for QuPath 0.7. It has been tested with QuPath 0.7.0 on Linux, Windows and macOS, but expect bugs and changes, and do not rely on it for work you cannot redo.

![QuPath with an H&E image: nuclei found by the StarDist2D app are drawn as annotations, next to the LabConstrictor tools window](https://raw.githubusercontent.com/CellMigrationLab/LabConstrictor-QuPath/main/docs/img/qupath-stardist.png)

## What you need

- [QuPath](https://qupath.github.io) 0.7.
- At least one LabConstrictor app installed on your computer. The app's installer registers it, which is how the extension finds it. Apps declare which hosts list them (`hosts:` in their `labconstrictor-app.yaml`). Apps without a declaration (installed with an older installer) are listed in every host and the Log says so ("declares no hosts"). Intended for QuPath: Playground, NucleiSky, Guess the Condition and StarDist2D. **VLab4Mic is not listed in QuPath** (it is for Napari and Fiji), and CellTracksColab is notebook-only.
- Only to build the jar yourself: JDK 25 (QuPath 0.7 is built with Java 25), as described in the repository's README.
- [QuPath](https://qupath.github.io) 0.7. Older QuPath versions are not supported.
- At least one LabConstrictor app that works in QuPath. The [App Centre](https://cellmigrationlab.github.io/LabConstrictor-Site/apps/?host=qupath) lists them. Installing the app and installing this extension are two separate steps: the app's installer registers the app on your computer, which is how the extension finds it.
- Nothing else: you do not need Java or Python of your own.

## Install

1. Download `labconstrictor-qupath-<tag>.jar` from the [Releases page](https://github.com/CellMigrationLab/LabConstrictor-QuPath/releases).
2. Drop the jar onto the QuPath window, or put it in the QuPath extensions folder (shown in QuPath's Preferences), and restart QuPath.

Without the jar: download the **single file** `LabConstrictorTools-all.groovy` from the same release, open it in QuPath's Script Editor and run it. The Script Editor needs this all-in-one file; the script in the repository is split into part files that do not run on their own there.
1. Download the extension's jar. The current version is `v0.1.0-alpha.7`: [download `labconstrictor-qupath-v0.1.0-alpha.7.jar`](https://github.com/CellMigrationLab/LabConstrictor-QuPath/releases/download/v0.1.0-alpha.7/labconstrictor-qupath-v0.1.0-alpha.7.jar). A newer version, when there is one, is at the top of the [Releases page](https://github.com/CellMigrationLab/LabConstrictor-QuPath/releases).
2. Drag the file onto the QuPath window, or copy it into the extensions folder shown in QuPath's Preferences.
3. Restart QuPath.

Full install page for the apps and all three hosts: [Tools `docs/INSTALL.md`](https://github.com/CellMigrationLab/LabConstrictor-Tools/blob/main/docs/INSTALL.md). To help test, report what you find in the [issue tracker](https://github.com/CellMigrationLab/LabConstrictor-QuPath/issues).
Without the jar: download the single file `LabConstrictorTools-all.groovy` from the same release, open it in QuPath's Script Editor and run it.

## Open it

Choose **Extensions > LabConstrictor tools...**, pick an app and a tool, and press Run.
1. Open an image in QuPath.
2. Choose **Extensions > LabConstrictor tools...**
3. Pick an app, then a tool. The form shows the tool's settings; hover over an **ⓘ** to read what a setting means.
4. Press **Run**.

![The LabConstrictor tools window in QuPath, showing the form of a tool](https://raw.githubusercontent.com/CellMigrationLab/LabConstrictor-QuPath/main/docs/img/qupath-form.png)

Good to know:

- An image input can be the image open in QuPath, another image of the open project, or a file.
- For a large image, choose the **Image area** to send: the whole image, the selected annotations, or what the viewer shows. Results come back on the right place of the slide. An area of more than 100 million pixels is refused with a message, never shrunk silently: choose a smaller area.
- Outlines and points found in the open image become annotations, named and classified after the app and the result (for example `StarDist2D:stardist_outlines`). When a tool finds more than 50 outlines they get no names, so that the names do not hide the image.
- When you run a tool again, it replaces only the annotations it drew itself. Your own annotations are never removed.
- Tables, values, messages and result images open in a results window. A result image has an **Open in QuPath** button.
- A progress bar and a **Cancel** button are there while a tool runs.
- A pixel-size setting is filled in from the image when the image says its pixel size. If it does not, the field stays empty and you type the value.
- A number outside the allowed range is refused with a message such as `'Threshold' must be <= 10`. It is never changed to fit.
- If you install another app while QuPath is open, press **Rescan apps**.

## Check that it worked

- An image input can be the image open in QuPath, any image of the open project, or a file.
- For large images, choose the **Image area**: the whole image, the selected annotations, or the current viewport. Results come back on the right place of the slide.
- Points and outlines found in the open image become annotations named after the app and the output. Outlines also get the classification `<app>:<output>`; above 50 outlines they get no names (QuPath would draw every name over the image) and are found by their classification, with their label as a measurement (`outline_index` when they have no label). A tool whose result replaces the previous one removes only the annotations it drew itself (they carry LabConstrictor metadata): your own annotations are never removed, even with the same classification.
- Results open in a window. Cancel stops a run.
Install the [Playground](https://cellmigrationlab.github.io/LabConstrictor-Site/apps/labconstrictor-playground/) app, pick it in the window and run its **Feature tour** tool without choosing an image: it makes its own small demo image. You should get the message "Found 16 blob(s)" and a results window with a label image and tables.

## If something does not work

- The status line and **Details** show what failed. The log is `~/.labconstrictor/logs/labconstrictor.log`.
- Results and run records are kept in `~/.labconstrictor/results` and `~/.labconstrictor/runs`. The extension never deletes them; after each run it starts `labconstrictor-tools prune`, which keeps the newest 20 results and 50 run records and removes only folders LabConstrictor made and finished. Folders from older versions of the extension are not removed automatically.
- The app's `labconstrictor-tools` must be 0.3.0a1 or newer; with an older one the run is refused and the status line says to update it.
- If you open another image while a tool runs, the results are not drawn on the new image: the status line says where the files are.
- An app whose `labconstrictor-tools` is older than 0.3.0a1 is not offered; the status line (or the list of skipped apps after **Rescan apps**) says to update it.
- An app can declare the oldest QuPath extension it needs. If yours is older, the status line warns and names the version to get; if the app marks it as required, the app is not offered (it is in the list of skipped apps) until you update the extension.
- A number you type that is outside the allowed range (or is not a number) is refused with a sentence like `'Threshold' must be <= 10`; it is never changed to fit, and the run does not start.
- `labconstrictor-tools doctor` shows which apps are registered.
- **No menu entry.** The extension needs QuPath 0.7 (**Help > About** shows your version). Check that the jar is in the extensions folder and restart QuPath.
- **"No LabConstrictor app is registered on this machine".** Install a LabConstrictor app, then press **Rescan apps**.
- **An app is missing from the list.** Press **Rescan apps**: the list of skipped apps says why. The app may not offer its tools in QuPath, it may have been installed with an old installer (install its newest version), or it may need a newer version of this extension (the message names the version to get).
- **A run fails.** The status line says what failed; **Details...** shows the full report. The log file is `~/.labconstrictor/logs/labconstrictor.log`.
- **You opened another image while a tool was running.** The results are not drawn on the new image; the status line says where the result files are.
- **You wonder where results are kept.** In `~/.labconstrictor/results` and `~/.labconstrictor/runs`. Only the newest 20 results and 50 run records are kept; older ones are removed automatically, and only folders that LabConstrictor itself made.
- **You want to know which apps are found.** `labconstrictor-tools doctor`, run in a terminal, shows which apps are registered.
- **You want to report a bug.** Open an [issue](https://github.com/CellMigrationLab/LabConstrictor-QuPath/issues) with what you ran and what you saw.

Source and issues: [LabConstrictor-QuPath](https://github.com/CellMigrationLab/LabConstrictor-QuPath).
Every rule the extension follows: [technical reference](https://github.com/CellMigrationLab/LabConstrictor-QuPath/blob/main/docs/REFERENCE.md). Source code and issues: [LabConstrictor-QuPath](https://github.com/CellMigrationLab/LabConstrictor-QuPath).
2 changes: 1 addition & 1 deletion tests/gui_test_conformance_body.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Thread.start("lc-gui-test") {
idsOf(WS.run_identity.fixtures) + idsOf(WS.async_lookups.fixtures) + idsOf(WS.number_limits.cases)) as List<String>
def LEDGER = [:]
["CF-01", "CF-07", "CF-08", "CF-09", "CF-10", "CF-11", "CF-12", "CF-14"].each { LEDGER[it] = "gui_test_frame_body" }
["CF-02", "CF-03", "CF-04", "CF-05", "CF-06", "CF-13"].each { LEDGER[it] = "n/a: QuPath has no spatial transform (README, coordinate frame)" }
["CF-02", "CF-03", "CF-04", "CF-05", "CF-06", "CF-13"].each { LEDGER[it] = "n/a: QuPath has no spatial transform (docs/REFERENCE.md, coordinate frame)" }
(1..20).each { LEDGER[String.format("CAL-%02d", it)] = "gui_test_calibration_body" }
(1..9).each { LEDGER["CAL-T" + it] = "gui_test_calibration_body" }
[1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13].each { LEDGER[String.format("RET-%02d", it)] = "n/a: run against Tools' retention.prune and its CLI, not a host test (the real prune is exercised by gui_test_retention_body)" }
Expand Down
Loading