Skip to content

Update spot_detection_2d: Add local_max detection method#220

Merged
kostrykin merged 17 commits into
BMCV:masterfrom
kostrykin:dev/spot_detection_2d
Mar 30, 2026
Merged

Update spot_detection_2d: Add local_max detection method#220
kostrykin merged 17 commits into
BMCV:masterfrom
kostrykin:dev/spot_detection_2d

Conversation

@kostrykin

@kostrykin kostrykin commented Mar 30, 2026

Copy link
Copy Markdown
Member

Re-implement the local_max detection method that detects local intensity maxima and was removed in #132. Note that the original results are reproduced if the intensity coordinate offset is set to –1/–1.

The PR also migrates from 1-based to 0-based indexing of the frames. This is to establish consistency with the "Starting time point" and "Ending time point" fields. Before this PR, the "Ending time point" was actually a time delta that was subtracted from the end of the sequence, instead of being a time point. With 0-based indexing, consistent slicing of the stack is easier to establish.

The PR also updates the dependency versions.


Bildschirmfoto 2026-03-30 um 15 21 07

Check-list for the contributor

Mandatory checks:

  • I have read the CONTRIBUTING.md document (last updated: 2026/03/06).
  • License permits unrestricted use (educational + commercial).
  • I agree to license these and all my past contributions to the Galaxy Image Analysis codebase under the MIT license.

If this PR adds or updates a tool or tool collection:

  • This PR adds a new tool or tool collection.
  • This PR updates an existing tool or tool collection.
  • Tools added/updated by this PR comply with the Guidelines below (or explain why they do not).

Guidelines for the contributor

This section is cited from the Naming and Annotation Conventions for Tools in the Image Community in Galaxy.

Naming

Generally, the name of Galaxy tools in our community should be expressive and concise, while stating the purpose of the tool as precisely as possible. Consistency of the namings of Galaxy tools is important to ensure they can be found easily. To maintain consistency, we consider phrasing names as imperatives a good practice, such as "Analyze particles" or "Perform segmentation using watershed transformation". An acknowledged exception from this rule is the names of tool wrappers of major tool suites, where the name of a tool wrapper should be chosen identically to the module or function of the tool which is wrapped (e.g., "MaskImage" in CellProfiler).

Tool description

If a Galaxy tool is a thin tool wrapper (e.g, part of a major tool suite), then the name of the wrapped tool (and only the name of the wrapped tool, subsequent to the term "with" as in "with Bioformats") should be used as the description of the tool (further examples include "with CellProfiler", "with ImageJ2", "with ImageMagick", "with SpyBOAT", "with SuperDSM"). This ensures that the tool is found by typing the name of the wrapped tool into the "Search" field on the Galaxy interface. The tool description should be empty if a tool is either not part of a major tool suite, or the main functionality of the tool is implemented in the wrapper.

Annotations

We point out that there is a global list of precedential annotations with Bio.tools identifiers (Ison et al., 2019) in Galaxy (see mappings), which may outweigh the annotations made in the XML specification of a Galaxy tool (and thus the annotations of a tool reported within the web interface of Galaxy might be divergent). However, since the precedential annotations are subject to possible changes and to avoid redundant work, we do not aim to reflect those in our specifications (those which we make in the XML specifications of Galaxy tools).

@kostrykin kostrykin added the Partitioning and Detection Image segmentation, partitioning, and detection label Mar 30, 2026
@kostrykin kostrykin marked this pull request as ready for review March 30, 2026 11:25
@kostrykin kostrykin requested a review from Copilot March 30, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reintroduces the local_max spot detection method for the spot_detection_2d Galaxy tool (previously removed in #132), updates the wrapper to pass parameters via a config JSON, adds input validators for 2-D single-channel images, and refreshes test fixtures/dependency pins.

Changes:

  • Add local_max (“Gaussian filtering”) detection method and wire it through the tool wrapper + Python implementation.
  • Refactor wrapper invocation to use giatools.ToolBaseplate style --params JSON and add validators for 2-D/single-channel inputs.
  • Update requirements and add/refresh test datasets and regression tests.

Reviewed changes

Copilot reviewed 4 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/spot_detection_2d/spot_detection_2d.xml Adds local_max option, validators, JSON-param config, updated requirements, and new/updated tests.
tools/spot_detection_2d/spot_detection_2d.py Implements local_max_detector, refactors detection dispatch, and switches CLI to ToolBaseplate.
tools/spot_detection_2d/validators.xml Imports shared validator macros used to reject non-2D / multi-channel inputs.
tools/spot_detection_2d/test-data/input1_tyx.tsv Updated expected TSV output for multi-frame test.
tools/spot_detection_2d/test-data/input2_yx.tsv Updated expected TSV output for single-frame test.
tools/spot_detection_2d/test-data/input2_yx.tiff New/updated single-frame test image fixture.
tools/spot_detection_2d/test-data/input3_tyx.tsv Added expected TSV output for local_max regression test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/spot_detection_2d/spot_detection_2d.xml
Comment thread tools/spot_detection_2d/spot_detection_2d.xml Outdated
Comment thread tools/spot_detection_2d/spot_detection_2d.py Outdated
Comment thread tools/spot_detection_2d/spot_detection_2d.py Outdated
@kostrykin kostrykin merged commit 9d52cec into BMCV:master Mar 30, 2026
12 checks passed
@kostrykin kostrykin deleted the dev/spot_detection_2d branch March 30, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Partitioning and Detection Image segmentation, partitioning, and detection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants