Class ImageParser2D

java.lang.Object
org.scijava.AbstractContextual
org.scijava.command.ContextCommand
sc.fiji.snt.analysis.sholl.parsers.ImageParser
sc.fiji.snt.analysis.sholl.parsers.ImageParser2D
All Implemented Interfaces:
Runnable, org.scijava.Cancelable, org.scijava.command.Command, org.scijava.Contextual, org.scijava.plugin.SciJavaPlugin, Parser, ProfileProperties

public class ImageParser2D extends ImageParser
Sholl Parser for 2D images
Author:
Tiago Ferreira
  • Field Details

    • MEAN

      public static final int MEAN
      Flag for integration of repeated measures: average
      See Also:
    • MEDIAN

      public static final int MEDIAN
      Flag for integration of repeated measures: median
      See Also:
    • MODE

      public static final int MODE
      Flag for integration of repeated measures: mode
      See Also:
    • MAX_N_SPANS

      public final int MAX_N_SPANS
      See Also:
  • Constructor Details

    • ImageParser2D

      public ImageParser2D(ij.ImagePlus imp)
    • ImageParser2D

      public ImageParser2D(ij.ImagePlus imp, org.scijava.Context context)
  • Method Details

    • setCenterPx

      public void setCenterPx(int x, int y)
    • setCenter

      public void setCenter(double x, double y)
    • setAggressiveSpikeSuppression

      public void setAggressiveSpikeSuppression(boolean enabled)
      Sets experimental spike suppression mode.

      When sampling binarized images, jagged (ladder-like) foreground edges can produce single-pixel "spikes" that go tangent to the sampling shell, registering as spurious intersections. This is not an algorithmic problem with Sholl analysis itself: it is an inherent consequence of rasterized circles intersecting rasterized structures.

      By default, (off), SNT uses legacy stair-aware suppression that only removes isolated ring hits matching specific diagonal staircase patterns in the source image. This is the same behavior as v4.x and is safe for all image types including skeletonized (1-pixel wide) structures.

      When enabled, SNT applies a stricter 1D morphological opening on the ring: any foreground pixel whose immediate ring neighbors are both background is suppressed. This effectively removes single-pixel noise but will also suppress genuine intersections where a thin neurite crosses the sampling shell at a steep angle, producing exactly one foreground pixel on the ring. Do not use with skeletonized images.

      Parameters:
      enabled - if true, applies aggressive 1D ring suppression (suitable for thick processes only). If false (default), uses legacy stair-aware suppression compatible with all image types.
    • setRadii

      public void setRadii(double startRadius, double step, double endRadius)
      Overrides:
      setRadii in class ImageParser
    • setRadii

      public void setRadii(double startRadius, double step, double endRadius, int span, int integrationFlag)
    • setRadiiSpan

      public void setRadiiSpan(int nSamples, int integrationFlag)
    • getProfile

      public Profile getProfile()
      Description copied from interface: Parser
      Gets the Sholl profile generated by the parsing operation.

      This method returns the profile containing intersection counts at various radial distances. The profile should only be retrieved after calling Parser.parse() and verifying success with Parser.successful().

      Specified by:
      getProfile in interface Parser
      Overrides:
      getProfile in class ImageParser
      Returns:
      the Sholl profile, or null if parsing has not been performed or was unsuccessful
    • parse

      public void parse()
      Description copied from interface: Parser
      Performs the parsing operation to extract the Sholl profile.

      This method analyzes the data source and computes intersection counts at various radial distances from the center point. The resulting profile can be retrieved using Parser.getProfile().

      Implementations should handle any necessary preprocessing, validation, and error handling during the parsing process.

      Specified by:
      parse in interface Parser
      Overrides:
      parse in class ImageParser
    • setPosition

      public void setPosition(int channel, int slice, int frame)