Class SeedRois

java.lang.Object
sc.fiji.snt.seed.SeedRois

public final class SeedRois extends Object
Bidirectional SeedPoint-Roi converter.
Author:
Tiago Ferreira
  • Method Details

    • toSeeds

      public static List<SeedPoint> toSeeds(ij.gui.Roi[] rois, ij.ImagePlus imp, double confidence, String type, String source)
      Converts the given ROIs to seeds.

      Rules per ROI type:

      • Area ROIs (oval, polygon, rectangle, freehand, traced): centroid as position, radius derived from the area of the matched circle (r = sqrt(area / pi))
      • Line ROIs: midpoint as position, radius = half the path length
      • Point ROIs: each contained point becomes its own seed with radius = 0. All points inherit the ROI's hyperstack position.
      • Other (e.g. ANGLE, COMPOSITE): bounds center as position, radius = 0.
      Parameters:
      rois - the input ROIs. null/empty array returns an empty list. null entries are skipped.
      imp - provides calibration and default C/T/Z. null yields uncalibrated (voxel-unit) coordinates and unset CT position.
      confidence - value assigned to every produced seed, clamped to [0, 1].
      type - value assigned to each seed's type field. null -> "".
      source - value assigned to each seed's source field (e.g. "roi"). null -> "".
      Returns:
      a list of seeds. Point ROIs may produce multiple seeds (one per contained point); a ROI with no usable geometry is skipped.
    • toRois

      public static List<ij.gui.Roi> toRois(Collection<SeedPoint> seeds, ij.ImagePlus imp)
      Converts the given seeds to ROIs.

      Seed radius is converted using the geometric mean of pixelWidth and pixelHeight so a 2D seed round-trip preserves the physical area of the equivalent disk

      Parameters:
      seeds - the input seed points. null/empty array returns an empty list. null entries are skipped.
      imp - provides calibration. null yields uncalibrated (voxel-unit) coordinates
      Returns:
      a list of ROIs (either PointROI (seeds without radius) or OvalRoi.