agentsclimarketplace

Tissue background segmentation

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/tissue-background-segmentation

Use when you have loaded a laser ablation ICP-MS image into pew² and need to distinguish tissue signal from instrument background or non-ablated substrate.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill tissue-background-segmentation

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.8 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Threshold-Based Tissue–Background Segmentation in LA-ICP-MS Images

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

Summary

Separates tissue pixels from background in laser ablation ICP-MS images using threshold-based methods (e.g., Otsu's method) applied through pew²'s Selection Dialog. This is essential for isolating regions of analytical interest before quantification or spatial analysis.

When to use

You have loaded a laser ablation ICP-MS image into pew² and need to distinguish tissue signal from instrument background or non-ablated substrate. Use this skill when the tissue and background occupy distinct intensity ranges and you want to create a binary mask that restricts downstream filtering, calibration, or export to tissue-only regions.

When NOT to use

  • Input image already has a pre-existing, validated tissue mask — use the mask filter directly instead.
  • Tissue and background have highly overlapping intensity distributions with no clear threshold — consider k-means clustering or manual region-of-interest selection.
  • You need to preserve intensity values within the tissue region — use mask filter after segmentation, not segment alone.

Inputs

  • LA-ICP-MS image (line-by-line, spot-wise, or ablation-time-aligned format supported by pew²)
  • Intensity data array (single element or mass channel)

Outputs

  • Binary mask image (pixels marked as tissue or background/NaN)
  • Selection overlay (visual confirmation on original image)

How to apply

Open the Selection Dialog via right-click context menu on the loaded LA-ICP-MS image in pew². Choose a thresholding method from the Method combo-box: Otsu's method (otsu filter) automatically computes an optimal threshold to minimize within-class variance, or manually set a threshold value. Set the Comparison operator (e.g., '>' to select pixels above the threshold, or '<' below) to define your segmentation criterion. Optionally restrict thresholding to an existing selection by checking 'Limit thresholding to selected value'. Apply the threshold to generate a binary mask. Verify segmentation quality by visualizing the resulting selection overlay on the image; adjust threshold parameters or operator if tissue/background separation is incomplete or includes spurious regions.

Related tools

  • pew² (GUI for importing, visualizing, and applying threshold-based segmentation to LA-ICP-MS images via the Selection Dialog) — https://github.com/djdt/pewpew
  • pewlib (Python library providing segment, otsu, and mask filter operations underlying pew²'s segmentation workflow) — https://github.com/djdt/pewlib

Evaluation signals

  • Binary mask contains only 0/1 or tissue/NaN values with no intermediate intensities.
  • Tissue pixels correspond to visually identifiable anatomical features in the original image overlay.
  • Selection boundary does not include spurious noise clusters or exclude continuous tissue regions.
  • Threshold value falls within the observed intensity range; operator direction (>, <, >=, <=) is consistent with tissue/background separation goal.
  • Mask can be successfully applied downstream (via 'mask' filter) to isolate tissue-only data for calibration or export without artifact propagation.

Limitations

  • Otsu's method assumes a bimodal intensity distribution; unimodal or multimodal data may produce suboptimal thresholds.
  • Fixed threshold does not adapt to spatial heterogeneity in ablation efficiency or matrix effects across the sample.
  • Thresholding is blind to morphological context; small isolated pixels or thin filaments may be misclassified.
  • No built-in edge-refinement or morphological post-processing (e.g., erosion/dilation) to smooth mask boundaries.
  • Relies on manual threshold tuning if automatic methods (Otsu) do not yield acceptable results.

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.: "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] 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 the segmentation criterion.: "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"
  • [other] Optionally check 'Limit thresholding to selected value' to restrict the thresholding operation to a pre-existing selection. Apply the threshold to generate a binary mask separating tissue pixels from background.: "Apply the threshold to generate a binary mask separating tissue pixels from background"
  • [readme] Pew² is a GUI for importing and processing line-by-line, spot-wise and ablation-time-aligned LA-ICP-MS data: "GUI for importing and processing line-by-line, spot-wise and ablation-time-aligned LA-ICP-MS data"
  • [methods] segment |image, threshold |creates a mask image of thesholds: "segment |image, threshold |creates a mask image of thesholds"

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.