Skip to content

Refactor ip_2d_feature_extraction tool (fix 3-D + add Zarr support)#183

Merged
kostrykin merged 19 commits intoBMCV:masterfrom
kostrykin:2d_feature_extraction
Jan 4, 2026
Merged

Refactor ip_2d_feature_extraction tool (fix 3-D + add Zarr support)#183
kostrykin merged 19 commits intoBMCV:masterfrom
kostrykin:2d_feature_extraction

Conversation

@kostrykin
Copy link
Copy Markdown
Member

@kostrykin kostrykin commented Dec 29, 2025

The tool hasn't been updated for a very long time and the code needs some serious rewriting to update to employ giatools.ToolBaseplate in order to also support 3-D images, Zarrs, and so on.

xref FAIR-imaging/galaxy-image-community#27 FAIR-imaging/galaxy-image-community#64

The convexity feature is removed. There already is solidity for quantification of convexity. The previous implementation rather looks like the "compactness" of the object, but not exactly.


screen

To be done:

  • Update to giatools 0.7.2 when it is available
  • Add test case for multi-channel Zarr
  • Verify new help section in planemo serve

Check-list for the contributor

Please make sure you have read the CONTRIBUTING.md document (last updated: 2025/12/22).

Mandatory checks:

  • 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
Copy link
Copy Markdown
Member Author

Blocked by BMCV/giatools#45

@kostrykin kostrykin changed the title Refactor ip_2d_feature_extraction tool Refactor ip_2d_feature_extraction tool (fix 3-D + add Zarr support) Dec 30, 2025
@kostrykin kostrykin added the Partitioning and Detection Image segmentation, partitioning, and detection label Dec 30, 2025
@kostrykin kostrykin requested a review from Copilot January 2, 2026 15:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refactors the ip_2d_feature_extraction tool to modernize its implementation by adopting giatools.ToolBaseplate, enabling support for 3-D images and Zarr format. The refactor removes the deprecated convexity feature (replaced by existing solidity) and updates the tool to current best practices.

Key changes:

  • Migration to giatools.ToolBaseplate architecture for improved image handling
  • Added Zarr format support with proper validation
  • Enhanced 3-D image processing capabilities with appropriate feature handling

Reviewed changes

Copilot reviewed 49 out of 78 changed files in this pull request and generated 3 comments.

File Description
tools/2d_feature_extraction/2d_feature_extraction.xml Updated tool definition with new parameters, Zarr support, comprehensive test cases, and improved help documentation
tools/2d_feature_extraction/2d_feature_extraction.py Complete rewrite using giatools.ToolBaseplate, added 3-D surface computation, Dask array handling, and streamlined feature extraction logic
tools/2d_feature_extraction/validators.xml Added symbolic link to shared validators
tools/2d_feature_extraction/test-data/* Added extensive test data including Zarr format examples and expected outputs for isolated feature validation

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

Comment thread tools/2d_feature_extraction/2d_feature_extraction.py Outdated
Comment thread tools/2d_feature_extraction/2d_feature_extraction.py Outdated
Comment thread tools/2d_feature_extraction/2d_feature_extraction.py Outdated
kostrykin and others added 3 commits January 2, 2026 16:55
@kostrykin kostrykin marked this pull request as ready for review January 4, 2026 20:08
@kostrykin kostrykin merged commit 97e1471 into BMCV:master Jan 4, 2026
11 checks passed
@kostrykin kostrykin deleted the 2d_feature_extraction branch January 4, 2026 20:09
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