com.xinapse.multisliceimage.roi
Class SmootherWorker
java.lang.Object
javax.swing.SwingWorker<ExitStatus,java.lang.Integer>
com.xinapse.util.MonitorWorker
com.xinapse.multisliceimage.roi.SmootherWorker
- All Implemented Interfaces:
- java.lang.Runnable, java.util.concurrent.Future<ExitStatus>, java.util.concurrent.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.
| Nested classes/interfaces inherited from class javax.swing.SwingWorker |
javax.swing.SwingWorker.StateValue |
|
Field Summary |
static float |
DEFAULT_MIN_RADIUS
The default minimum radius of curvature for sections. |
|
Constructor Summary |
SmootherWorker(CanAddROIToFrame canAddROIToFrame,
IrregularROI roi,
float pixelXSize,
float pixelYSize)
Create a SmootherWorker to make an IrregularROI convex, or at
least less concave. |
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. |
|
Method Summary |
ExitStatus |
doInBackground()
Run the SmootherWorker to make an IrregularROI convex, or at least less concave. |
void |
done()
Overrides the done() method. |
ROI |
getSmoothedROI()
After the SmootherWorker has run to completion, returns the smoothed ROI. |
| Methods inherited from class javax.swing.SwingWorker |
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_MIN_RADIUS
public static final float DEFAULT_MIN_RADIUS
- The default minimum radius of curvature for sections.
- See Also:
- Constant Field Values
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.
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 ROI getSmoothedROI()
- After the SmootherWorker has run to completion, returns the smoothed ROI.
- Returns:
- the smoothed ROI.
Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.