Class SmootherWorker

All Implemented Interfaces:
Runnable, Future<ExitStatus>, RunnableFuture<ExitStatus>

public class SmootherWorker extends MonitorWorker
This SwingWorker is used to smooth IrregularROIs. A smoothed ROI is made to have parts that are less concave than the original version. The user can specifiy a minimum radius of curvature that will be applied: all concave parts of the ROI will have a radius of curvature of at least the minimum.
  • Field Details

    • DEFAULT_MIN_RADIUS

      public static final float DEFAULT_MIN_RADIUS
      The default minimum radius of curvature for sections.
      See Also:
  • Constructor Details

    • SmootherWorker

      public SmootherWorker(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize)
      Create a SmootherWorker to make an IrregularROI convex, or at least less concave. The supplied pixel sizes are used to decide on the separation between data points around the ROI. The default minimum radius DEFAULT_MIN_RADIUS for concave sections will be applied.
      Parameters:
      canAddROIToFrame - the CanAddROIToFrame that will (if non-null) be updated when this SmootherWorker has finished.
      roi - the IrregularROI to be made less concave.
      pixelXSize - the width of an image pixel in mm.
      pixelYSize - the height of an image pixel in mm.
    • SmootherWorker

      public SmootherWorker(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize, float minConcaveRadius)
      Create a SmootherWorker to make an IrregularROI convex, or at least less concave, with a user-supplied minimum radius of (concave) curvature. The supplied pixel sizes are used to decide on the separation between data points around the ROI. A minimum radius of curvature for concave radii of curvature is given.
      Parameters:
      canAddROIToFrame - the CanAddROIToFrame that will (if non-null) be updated when this SmootherWorker has finished.
      roi - the IrregularROI to be made less concave.
      pixelXSize - the width of an image pixel in mm.
      pixelYSize - the height of an image pixel in mm.
      minConcaveRadius - the minimum radius of curvature for concave parts of this ROI.
  • Method Details

    • doInBackground

      public ExitStatus doInBackground()
      Run the SmootherWorker to make an IrregularROI convex, or at least less concave. After the SmootherWorker has run to completion, the ImageDisplayer will redisplay the smoothed ROI.
      Specified by:
      doInBackground in class MonitorWorker
      Returns:
      the ExitStatus indicating whether the processing was successful, and if not why not.
    • done

      public void done()
      Description copied from class: MonitorWorker
      Overrides the done() method. Closes the ProgressMonitor or IndeterminateProgressMonitor.
      Overrides:
      done in class MonitorWorker
    • getSmoothedROI

      public IrregularROI getSmoothedROI()
      After the SmootherWorker has run to completion, returns the smoothed ROI.
      Returns:
      the smoothed ROI.