agentsclimarketplace

Image threshold method selection

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/image-threshold-method-selection

Use when you have loaded a laser ablation ICP-MS image into pewpew and need to separate tissue pixels from background regions to enable region-based analysis or quantification.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill image-threshold-method-selection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

6.6 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

image-threshold-method-selection

License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->

Summary

Select and apply an appropriate thresholding method (e.g., Otsu's method) to segment tissue from background in laser ablation ICP-MS images. This skill involves choosing a comparison operator and optional restriction to pre-existing selections to generate binary masks that separate regions of interest.

When to use

You have loaded a laser ablation ICP-MS image into pewpew and need to separate tissue pixels from background regions to enable region-based analysis or quantification. Use this skill when the Selection Dialog is available and you need to apply threshold-based segmentation rather than manual selection.

When NOT to use

  • The image already contains a manually curated or previously validated selection that does not require re-segmentation.
  • Input data is not a 2D LA-ICP-MS image (e.g., if it is a 1D line scan or raw time-series data before image construction).
  • Tissue-background contrast is too low or ambiguous for any threshold-based method to produce meaningful separation.

Inputs

  • LA-ICP-MS image (line-by-line, spot-wise, or ablation-time-aligned formats from Agilent, Thermo, PerkinElmer, or delimited text)
  • optional: pre-existing selection region

Outputs

  • binary mask image separating tissue from background
  • selection overlay visualization

How to apply

Open the Selection Dialog via right-click context menu on the loaded image. Select a thresholding method from the Method combo-box (Otsu's method is recommended for automatic threshold determination without user-specified values). Set the Comparison operator (e.g., '>' to select pixels above the threshold, '<' for below) to define the segmentation criterion. Optionally check 'Limit thresholding to selected value' to restrict the operation to a pre-existing selection rather than the entire image. Apply the threshold to generate a binary mask. Visualize the resulting selection overlay on the image to confirm segmentation quality before proceeding with downstream analysis.

Related tools

  • pewpew (GUI application for importing, visualizing, and interactively segmenting LA-ICP-MS images via the Selection Dialog) — https://github.com/djdt/pewpew
  • pewlib (Python library providing the filter operations (segment, otsu, mask) that implement threshold-based segmentation) — https://github.com/djdt/pewlib

Evaluation signals

  • The binary mask correctly isolates tissue pixels and excludes background regions, verifiable by visual inspection of the selection overlay.
  • The threshold value selected by the method (or user-specified) is appropriate for the image's dynamic range and does not over- or under-segment.
  • Pixels classified as tissue in the mask have higher intensity values than background pixels when the comparison operator is correctly applied.
  • If 'Limit thresholding to selected value' was checked, the mask respects the pre-existing selection boundary and does not extend beyond it.
  • Downstream quantification results (e.g., elemental concentrations in tissue regions) are consistent with expected ranges and do not show artifacts from segmentation errors.

Limitations

  • Otsu's method and other automatic thresholding approaches assume a bimodal (or simple multimodal) intensity distribution; they may fail on images with complex or overlapping tissue/background intensity ranges.
  • The Selection Dialog thresholding is applied to a single image; if multiple images require consistent segmentation criteria, the user must manually apply the same parameters to each image or use batch processing.
  • No changelog is available for pewlib or pewpew, limiting ability to track changes in filter behavior or thresholding algorithm updates.
  • Thresholding alone does not account for spatial structure or connectivity; isolated noise pixels meeting the threshold criterion will also be included in the mask.

Evidence

  • [other] The pew² application implements segmentation through filter operations including Otsu's method and threshold-based masking: "the 'segment' filter creates a mask image from thresholds, the 'otsu' filter applies Otsu's method to an image, and the 'mask' filter selects regions from an image using a binary mask."
  • [other] Workflow for applying threshold-based segmentation in pewpew: "Open the Selection Dialog via right-click context menu on the image. Select a thresholding method (e.g., Otsu's method) from the Method combo-box and set the Comparison operator (e.g., '>') to define"
  • [other] Optional restriction of thresholding operation: "Optionally check 'Limit thresholding to selected value' to restrict the thresholding operation to a pre-existing selection."
  • [other] Segmentation output and verification: "Apply the threshold to generate a binary mask separating tissue pixels from background. Visualize the resulting selection overlay on the image to confirm segmentation quality."
  • [readme] Pew² core functionality for LA-ICP-MS data: "Pew² is a GUI for importing and processing line-by-line, spot-wise and ablation-time-aligned LA-ICP-MS data using the python library [pewlib]"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.