Class SegmentInstanceWithModel<T extends InferenceModel>
Object
AnchorBean<Task<StackSequenceInput, SharedStateSegmentInstance<T>>>
Task<StackSequenceInput, SharedStateSegmentInstance<T>>
SegmentInstanceWithModel<T>
- Type Parameters:
T- model-type in pool
public class SegmentInstanceWithModel<T extends InferenceModel>
extends Task<StackSequenceInput, SharedStateSegmentInstance<T>>
Using a model-pool, performs instance segmentation on an image producing zero, one or more
objects per image.
Various visualizations and export types are supported.
- Segmentation results in vairous forms (HDF5) for input into other scripts. (in HDF5 form and as a mask).
- Visualizations of the instances found (outlines, thumbnails etc.)
- A table of basic features (CSV) for each instance.
Specifically, the following outputs are produced:
| Output Name | Default? | Description |
|---|---|---|
| "input" | no | The input image for segmentation. |
| "objects" | yes | Segmented object-masks encoded into HDF5. |
| "mask" | yes | A binary-mask image that binary ors each voxel across the segmented object-masks (scaled to match the input image). |
| "outline" | yes | A RGB image showing the outline of segmented-objects on top of the input image (scaled to match the input image). |
| "mask""SegmentScale" | no | Like mask but scaled to match the input used for segmentation. |
| "outline""SegmentScale" | no | Like outline but scaled to match the input used for segmentation. |
| "summary" | yes | A CSV file showing basic feature of all segmented-objects across all input images. |
| "thumbnails"<S> | yes | A directory of thumbnails showing the outline of all segmented objects on top of an extracted portion of the respective input-image. |
outputs inherited from Task |
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterAllJobsAreExecuted(SharedStateSegmentInstance<T> sharedState, InputOutputContext context) beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan plan, List<StackSequenceInput> inputs, ParametersExperiment parameters) voidcheckMisconfigured(BeanInstanceMap defaultInstances) OutputEnabledMutablevoiddoJobOnInput(InputBound<StackSequenceInput, SharedStateSegmentInstance<T>> input) List<NamedBean<FeatureListProvider<FeatureInputSingleObject>>> Features to calculate for objects in the features output.InterpolatorThe interpolator to use for scaling images.RGBColorBeanThe color of the outline.intThe width of the outline.SegmentStackIntoObjectsPooled<T> The segmentation algorithm.getStyle()Visual style for how feature export occurs.booleanInputTypesExpectedbooleanWhen true, then the outputs (outline, mask, image etc.) are not written for images that produce no objects.booleanWhen true, the colors change for different objects in the image (using a default color set).voidsetFeatures(List<NamedBean<FeatureListProvider<FeatureInputSingleObject>>> features) Features to calculate for objects in the features output.voidsetIgnoreNoObjects(boolean ignoreNoObjects) When true, then the outputs (outline, mask, image etc.) are not written for images that produce no objects.voidsetInterpolator(Interpolator interpolator) The interpolator to use for scaling images.voidsetOutlineColor(RGBColorBean outlineColor) The color of the outline.voidsetOutlineWidth(int outlineWidth) The width of the outline.voidsetSegment(SegmentStackIntoObjectsPooled<T> segment) The segmentation algorithm.voidsetStyle(ExportFeaturesStyle style) Visual style for how feature export occurs.voidsetVaryColors(boolean varyColors) When true, the colors change for different objects in the image (using a default color set).Methods inherited from class org.anchoranalysis.experiment.bean.task.Task
executeJob, isInputCompatibleWithMethods inherited from class org.anchoranalysis.bean.AnchorBean
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
SegmentInstanceWithModel
public SegmentInstanceWithModel()
-
-
Method Details
-
checkMisconfigured
public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException - Overrides:
checkMisconfiguredin classAnchorBean<Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>>- Throws:
BeanMisconfiguredException
-
inputTypesExpected
public InputTypesExpected inputTypesExpected()- Specified by:
inputTypesExpectedin classTask<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
-
beforeAnyJobIsExecuted
public SharedStateSegmentInstance<T> beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan plan, List<StackSequenceInput> inputs, ParametersExperiment parameters) throws ExperimentExecutionException - Specified by:
beforeAnyJobIsExecutedin classTask<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>- Throws:
ExperimentExecutionException
-
doJobOnInput
public void doJobOnInput(InputBound<StackSequenceInput, SharedStateSegmentInstance<T>> input) throws JobExecutionException - Specified by:
doJobOnInputin classTask<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>- Throws:
JobExecutionException
-
hasVeryQuickPerInputExecution
public boolean hasVeryQuickPerInputExecution()- Specified by:
hasVeryQuickPerInputExecutionin classTask<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
-
defaultOutputs
public OutputEnabledMutable defaultOutputs()- Overrides:
defaultOutputsin classTask<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
-
getSegment
The segmentation algorithm. -
setSegment
The segmentation algorithm. -
getOutlineColor
public RGBColorBean getOutlineColor()The color of the outline. -
isVaryColors
public boolean isVaryColors()When true, the colors change for different objects in the image (using a default color set).This takes precedence over
outlineColor. -
setVaryColors
public void setVaryColors(boolean varyColors) When true, the colors change for different objects in the image (using a default color set).This takes precedence over
outlineColor. -
getOutlineWidth
public int getOutlineWidth()The width of the outline. -
setOutlineWidth
public void setOutlineWidth(int outlineWidth) The width of the outline. -
getFeatures
Features to calculate for objects in the features output.If unspecified, default features of bounding-box coordinates and number of voxels are selected.
-
setFeatures
Features to calculate for objects in the features output.If unspecified, default features of bounding-box coordinates and number of voxels are selected.
-
isIgnoreNoObjects
public boolean isIgnoreNoObjects()When true, then the outputs (outline, mask, image etc.) are not written for images that produce no objects. -
setIgnoreNoObjects
public void setIgnoreNoObjects(boolean ignoreNoObjects) When true, then the outputs (outline, mask, image etc.) are not written for images that produce no objects. -
getStyle
Visual style for how feature export occurs. -
setStyle
Visual style for how feature export occurs. -
getInterpolator
public Interpolator getInterpolator()The interpolator to use for scaling images. -
setInterpolator
public void setInterpolator(Interpolator interpolator) The interpolator to use for scaling images.
-