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 NameDefault?Description
"input"noThe input image for segmentation.
"objects"yesSegmented object-masks encoded into HDF5.
"mask"yesA binary-mask image that binary ors each voxel across the segmented object-masks (scaled to match the input image).
"outline"yesA RGB image showing the outline of segmented-objects on top of the input image (scaled to match the input image).
"mask""SegmentScale"noLike mask but scaled to match the input used for segmentation.
"outline""SegmentScale"noLike outline but scaled to match the input used for segmentation.
"summary"yesA CSV file showing basic feature of all segmented-objects across all input images.
"thumbnails"<S>yesA 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 Details

    • SegmentInstanceWithModel

      public SegmentInstanceWithModel()
  • Method Details

    • checkMisconfigured

      public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
      Overrides:
      checkMisconfigured in class AnchorBean<Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>>
      Throws:
      BeanMisconfiguredException
    • inputTypesExpected

      public InputTypesExpected inputTypesExpected()
      Specified by:
      inputTypesExpected in class Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
    • beforeAnyJobIsExecuted

      public SharedStateSegmentInstance<T> beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan plan, List<StackSequenceInput> inputs, ParametersExperiment parameters) throws ExperimentExecutionException
      Specified by:
      beforeAnyJobIsExecuted in class Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
      Throws:
      ExperimentExecutionException
    • doJobOnInput

      public void doJobOnInput(InputBound<StackSequenceInput, SharedStateSegmentInstance<T>> input) throws JobExecutionException
      Specified by:
      doJobOnInput in class Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
      Throws:
      JobExecutionException
    • afterAllJobsAreExecuted

      public void afterAllJobsAreExecuted(SharedStateSegmentInstance<T> sharedState, InputOutputContext context) throws ExperimentExecutionException
      Specified by:
      afterAllJobsAreExecuted in class Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
      Throws:
      ExperimentExecutionException
    • hasVeryQuickPerInputExecution

      public boolean hasVeryQuickPerInputExecution()
      Specified by:
      hasVeryQuickPerInputExecution in class Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
    • defaultOutputs

      public OutputEnabledMutable defaultOutputs()
      Overrides:
      defaultOutputs in class Task<StackSequenceInput, SharedStateSegmentInstance<T extends InferenceModel>>
    • getSegment

      public SegmentStackIntoObjectsPooled<T> getSegment()
      The segmentation algorithm.
    • setSegment

      public void setSegment(SegmentStackIntoObjectsPooled<T> segment)
      The segmentation algorithm.
    • getOutlineColor

      public RGBColorBean getOutlineColor()
      The color of the outline.
    • setOutlineColor

      public void setOutlineColor(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<NamedBean<FeatureListProvider<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<NamedBean<FeatureListProvider<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

      public ExportFeaturesStyle getStyle()
      Visual style for how feature export occurs.
    • setStyle

      public void setStyle(ExportFeaturesStyle style)
      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.