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 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 Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatThe default minimum radius of curvature for sections.Fields inherited from class com.xinapse.util.MonitorWorker
errorMessage, indeterminateMonitor, monitor -
Constructor Summary
ConstructorsConstructorDescriptionSmootherWorker(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize) Create aSmootherWorkerto make anIrregularROIconvex, or at least less concave.SmootherWorker(CanAddROIToFrame canAddROIToFrame, IrregularROI roi, float pixelXSize, float pixelYSize, float minConcaveRadius) Create aSmootherWorkerto make anIrregularROIconvex, 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.voiddone()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, setActionMethods 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 aSmootherWorkerto make anIrregularROIconvex, 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_RADIUSfor concave sections will be applied.- Parameters:
canAddROIToFrame- theCanAddROIToFramethat will (if non-null) be updated when thisSmootherWorkerhas finished.roi- theIrregularROIto 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 aSmootherWorkerto make anIrregularROIconvex, 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- theCanAddROIToFramethat will (if non-null) be updated when thisSmootherWorkerhas finished.roi- theIrregularROIto 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 theSmootherWorkerhas run to completion, theImageDisplayerwill redisplay the smoothed ROI.- Specified by:
doInBackgroundin classMonitorWorker- Returns:
- the
ExitStatusindicating whether the processing was successful, and if not why not.
-
done
public void done()Description copied from class:MonitorWorker- Overrides:
donein classMonitorWorker
-
getSmoothedROI
After the SmootherWorker has run to completion, returns the smoothed ROI.- Returns:
- the smoothed ROI.
-