Package sc.fiji.snt

Class DelineationsManager

java.lang.Object
sc.fiji.snt.DelineationsManager

public class DelineationsManager extends Object
Implements the Delineation Analysis pane.
Author:
Tiago Ferreira
  • Constructor Details

    • DelineationsManager

      public DelineationsManager(SNTUI sntui)
  • Method Details

    • getPanel

      protected JPanel getPanel()
    • reset

      public void reset()
      Deletes all delineations.
    • getDelineationROIs

      public List<ij.gui.Roi> getDelineationROIs()
    • load

      public int load(List<ij.gui.Roi> delineationROIs)
      Loads delineations from a list of area ROIs. Each ROI is mapped to a delineation entry, and path nodes whose XY coordinates fall within the ROI are assigned to the corresponding delineation. If an ROI has been renamed or colored (stroke or fill), those properties are transferred to the delineation.
      Parameters:
      delineationROIs - the area ROIs to import; null or empty lists return 0
      Returns:
      the number of ROIs successfully associated with at least one path
    • importFromLabelImage

      public int importFromLabelImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> labelImg)
      Imports delineations from a labels image. Each unique non-zero integer value becomes a delineation. Path nodes are assigned based on the label value at their pixel coordinates. The label image is stored internally for on-the-fly distance computation in measure().
      Parameters:
      labelImg - the labels image (XYZ or XY); 0 = background
      Returns:
      the number of unique labels imported
    • importFromLabelImage

      public int importFromLabelImage(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> labelImg, double[] spacing)
      Imports delineations from a labels image with explicit pixel spacing.
      Parameters:
      labelImg - the labels image (XYZ or XY); 0 = background
      spacing - pixel spacing [x, y] or [x, y, z]; if null, spacing is inferred from axes metadata (if ImgPlus) or defaults to [1, 1, 1]
      Returns:
      the number of unique labels imported
    • importFromLabelImage

      public int importFromLabelImage(ij.ImagePlus labelImp)
      Convenience overload accepting an ImagePlus, which is converted to an ImgPlus via ImpUtils.toImgPlus3D(ImagePlus, int, int).
      Parameters:
      labelImp - the labels ImagePlus
      Returns:
      the number of unique labels imported
    • hasDelineationLabels

      public static boolean hasDelineationLabels(Collection<Tree> trees)
      Checks if the given trees have any delineation labels.
      Parameters:
      trees - the collection of trees to be inspected
      Returns:
      true if any of the trees has delineation labels, false otherwise
    • hasDelineationLabels

      public static boolean hasDelineationLabels(Tree tree)
      Checks if the given tree has any delineation labels.
      Parameters:
      tree - the collection of paths to be inspected
      Returns:
      true if the tree has delineation labels, false otherwise