Class SegmentInstanceWithModel<T extends org.anchoranalysis.inference.InferenceModel>
Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.experiment.bean.task.Task<T,S>>
org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T>>
org.anchoranalysis.plugin.image.task.bean.segment.SegmentInstanceWithModel<T>
- Type Parameters:
T- model-type in pool
public class SegmentInstanceWithModel<T extends org.anchoranalysis.inference.InferenceModel> extends org.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.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 for model inference). |
| "outline" | yes | A RGB image showing the outline of segmented-objects on top of the input image (scaled to match the input image for model inference). |
| "mask""InputScale" | no | Like mask but on the full-scale input image. |
| "outline""InputScale" | no | Like outline but on on the full-scale input image. |
| "summary" | yes | A CSV file showing basic feature of all segmented-objects across all input images. |
| "thumbnails" | 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 Constructor Description SegmentInstanceWithModel() -
Method Summary
Modifier and Type Method Description voidafterAllJobsAreExecuted(SharedStateSegmentInstance<T> sharedState, org.anchoranalysis.io.output.outputter.InputOutputContext context)SharedStateSegmentInstance<T>beforeAnyJobIsExecuted(org.anchoranalysis.io.output.outputter.Outputter outputter, org.anchoranalysis.inference.concurrency.ConcurrencyPlan plan, List<org.anchoranalysis.image.io.stack.input.StackSequenceInput> inputs, org.anchoranalysis.experiment.task.ParametersExperiment parameters)org.anchoranalysis.io.output.enabled.OutputEnabledMutabledefaultOutputs()voiddoJobOnInput(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T>> input)List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>>getFeatures()Features to calculate for objects in the features output.org.anchoranalysis.image.bean.interpolator.InterpolatorgetInterpolator()The interpolator to use for scaling images.org.anchoranalysis.bean.shared.color.RGBColorBeangetOutlineColor()The color of the outline.intgetOutlineWidth()The width of the outline.org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled<T>getSegment()The segmentation algorithm.ExportFeaturesStylegetStyle()Visual style for how feature export occurs.booleanhasVeryQuickPerInputExecution()org.anchoranalysis.experiment.task.InputTypesExpectedinputTypesExpected()booleanisIgnoreNoObjects()When true, then the outputs (outline, mask, image etc.) are not written for images that produce no objects.booleanisVaryColors()When true, the colors change for different objects in the image (using a default color set).voidsetFeatures(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.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(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)The interpolator to use for scaling images.voidsetOutlineColor(org.anchoranalysis.bean.shared.color.RGBColorBean outlineColor)The color of the outline.voidsetOutlineWidth(int outlineWidth)The width of the outline.voidsetSegment(org.anchoranalysis.image.inference.bean.segment.instance.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, isInputCompatibleWith
-
Constructor Details
-
SegmentInstanceWithModel
public SegmentInstanceWithModel()
-
-
Method Details
-
inputTypesExpected
public org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()- Specified by:
inputTypesExpectedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>>
-
beforeAnyJobIsExecuted
public SharedStateSegmentInstance<T> beforeAnyJobIsExecuted(org.anchoranalysis.io.output.outputter.Outputter outputter, org.anchoranalysis.inference.concurrency.ConcurrencyPlan plan, List<org.anchoranalysis.image.io.stack.input.StackSequenceInput> inputs, org.anchoranalysis.experiment.task.ParametersExperiment parameters) throws org.anchoranalysis.experiment.ExperimentExecutionException- Specified by:
beforeAnyJobIsExecutedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>>- Throws:
org.anchoranalysis.experiment.ExperimentExecutionException
-
doJobOnInput
public void doJobOnInput(org.anchoranalysis.experiment.task.InputBound<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T>> input) throws org.anchoranalysis.experiment.JobExecutionException- Specified by:
doJobOnInputin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>>- Throws:
org.anchoranalysis.experiment.JobExecutionException
-
afterAllJobsAreExecuted
public void afterAllJobsAreExecuted(SharedStateSegmentInstance<T> sharedState, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.ExperimentExecutionException- Specified by:
afterAllJobsAreExecutedin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>>- Throws:
org.anchoranalysis.experiment.ExperimentExecutionException
-
hasVeryQuickPerInputExecution
public boolean hasVeryQuickPerInputExecution()- Specified by:
hasVeryQuickPerInputExecutionin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>>
-
defaultOutputs
public org.anchoranalysis.io.output.enabled.OutputEnabledMutable defaultOutputs()- Overrides:
defaultOutputsin classorg.anchoranalysis.experiment.bean.task.Task<org.anchoranalysis.image.io.stack.input.StackSequenceInput,SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>>
-
getSegment
public org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled<T> getSegment()The segmentation algorithm. -
setSegment
public void setSegment(org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled<T> segment)The segmentation algorithm. -
getOutlineColor
public org.anchoranalysis.bean.shared.color.RGBColorBean getOutlineColor()The color of the outline. -
setOutlineColor
public void setOutlineColor(org.anchoranalysis.bean.shared.color.RGBColorBean outlineColor)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
public List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>> 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
public void setFeatures(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>> features)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 org.anchoranalysis.image.bean.interpolator.Interpolator getInterpolator()The interpolator to use for scaling images. -
setInterpolator
public void setInterpolator(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)The interpolator to use for scaling images.
-