Package com.xinapse.multisliceimage.roi
Class SmootherWorker
java.lang.Object
javax.swing.SwingWorker<ExitStatus,Integer>
com.xinapse.util.MonitorWorker
com.xinapse.multisliceimage.roi.SmootherWorker
- All Implemented Interfaces:
Runnable
,Future<ExitStatus>
,RunnableFuture<ExitStatus>
This
SwingWorker
is used to smooth IrregularROI
s.
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 Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
The default minimum radius of curvature for sections.Fields inherited from class com.xinapse.util.MonitorWorker
errorMessage, indeterminateMonitor, monitor
-
Constructor Summary
ConstructorDescriptionSmootherWorker
(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize) Create aSmootherWorker
to make anIrregularROI
convex, or at least less concave.SmootherWorker
(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize, float minConcaveRadius) Create aSmootherWorker
to make anIrregularROI
convex, or at least less concave, with a user-supplied minimum radius of (concave) curvature. -
Method Summary
Modifier and TypeMethodDescriptionRun the SmootherWorker to make an IrregularROI convex, or at least less concave.void
done()
Overrides thedone()
method.After the SmootherWorker has run to completion, returns the smoothed ROI.Methods inherited from class com.xinapse.util.MonitorWorker
checkCancelled, checkCancelled, checkCancelled, checkCancelled, getComponent, getProgName, setAction, setAction
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
-
Field Details
-
DEFAULT_MIN_RADIUS
public static final float DEFAULT_MIN_RADIUSThe default minimum radius of curvature for sections.- See Also:
-
-
Constructor Details
-
SmootherWorker
public SmootherWorker(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize) Create aSmootherWorker
to make anIrregularROI
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 radiusDEFAULT_MIN_RADIUS
for concave sections will be applied.- Parameters:
canAddROIToFrame
- theCanAddROIToFrame
that will (if non-null) be updated when thisSmootherWorker
has finished.roi
- theIrregularROI
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 aSmootherWorker
to make anIrregularROI
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
- theCanAddROIToFrame
that will (if non-null) be updated when thisSmootherWorker
has finished.roi
- theIrregularROI
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
Run the SmootherWorker to make an IrregularROI convex, or at least less concave. After theSmootherWorker
has run to completion, theImageDisplayer
will redisplay the smoothed ROI.- Specified by:
doInBackground
in classMonitorWorker
- Returns:
- the
ExitStatus
indicating whether the processing was successful, and if not why not.
-
done
public void done()Description copied from class:MonitorWorker
- Overrides:
done
in classMonitorWorker
-
getSmoothedROI
After the SmootherWorker has run to completion, returns the smoothed ROI.- Returns:
- the smoothed ROI.
-