Class SegmentStackIntoObjectsScaleDecode<T,​S extends ImageInferenceModel<T>>

Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<T,​org.anchoranalysis.image.bean.nonbean.init.ImageInitialization>
org.anchoranalysis.image.bean.ImageBean<T>
org.anchoranalysis.image.bean.segment.SegmentationBean<SegmentStackIntoObjectsPooled<T>>
org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled<S>
org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsScaleDecode<T,​S>
Type Parameters:
T - tensor-type inputted and outputted to model
S - model-type

public abstract class SegmentStackIntoObjectsScaleDecode<T,​S extends ImageInferenceModel<T>>
extends SegmentStackIntoObjectsPooled<S>
A SegmentStackIntoObjectsScaleDecode that scales the input image, before performing inference, and then decodes the output.
Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • segment

      public SegmentedObjects segment​(Stack stack, ConcurrentModelPool<S> modelPool, ExecutionTimeRecorder executionTimeRecorder) throws org.anchoranalysis.image.bean.nonbean.segment.SegmentationFailedException
      Description copied from class: SegmentStackIntoObjectsPooled
      Segments a stack to produce an object-collection.

      Any created objects will always exist inside the stack's Extent.

      Specified by:
      segment in class SegmentStackIntoObjectsPooled<S extends ImageInferenceModel<T>>
      Parameters:
      stack - the stack to segment.
      modelPool - the pool of model instances which can each be used for inference (in parallel).
      executionTimeRecorder - measures execution-times of particular operations.
      Returns:
      a collection of objects with corresponding confidence scores.
      Throws:
      org.anchoranalysis.image.bean.nonbean.segment.SegmentationFailedException - if anything goes wrong during the segmentation.
    • deriveInput

      protected abstract T deriveInput​(Stack stack, Optional<double[]> subtractMeans) throws OperationFailedException
      Derives the input tensor from an image.
      Parameters:
      stack - the image which is mapped into an input tensor.
      subtractMeans - respective intensity values that are subtracted from the voxels before being added to the tensor (respectively for each channel).
      Returns:
      the tensor, representing the input image.
      Throws:
      OperationFailedException - if an input tensor cannot be created.
    • inputName

      protected abstract Optional<String> inputName()
      The name of the tensor in the model which the input-image is mapped to.
      Returns:
      the name.
    • getScaleInput

      public org.anchoranalysis.image.bean.spatial.ScaleCalculator getScaleInput()
      Any scaling to be applied to the input-image before being input to the model for inference.
    • setScaleInput

      public void setScaleInput​(org.anchoranalysis.image.bean.spatial.ScaleCalculator scaleInput)
      Any scaling to be applied to the input-image before being input to the model for inference.
    • getDecode

      public DecodeInstanceSegmentation<T> getDecode()
      Decodes inference output into segmented objects.
    • setDecode

      public void setDecode​(DecodeInstanceSegmentation<T> decode)
      Decodes inference output into segmented objects.
    • getSubtractMean

      public DoubleList getSubtractMean()
      A constant intensity for each respective channel to be subtracted before performing inference.

      If set, this should create an list, with as many elements as channels inputted to the inference model.

    • setSubtractMean

      public void setSubtractMean​(DoubleList subtractMean)
      A constant intensity for each respective channel to be subtracted before performing inference.

      If set, this should create an list, with as many elements as channels inputted to the inference model.

    • getClassLabelsPath

      public String getClassLabelsPath()
      Relative-path to the class-labels file, a text file where each line specifies a class label in order, relative to the models/ directory in the Anchor distribution.

      If empty, then no such file is specified.

    • setClassLabelsPath

      public void setClassLabelsPath​(String classLabelsPath)
      Relative-path to the class-labels file, a text file where each line specifies a class label in order, relative to the models/ directory in the Anchor distribution.

      If empty, then no such file is specified.

    • 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.
    • getDisplayer

      public org.anchoranalysis.image.bean.displayer.StackDisplayer getDisplayer()
      How to convert an image to be displayed to the user.
    • setDisplayer

      public void setDisplayer​(org.anchoranalysis.image.bean.displayer.StackDisplayer displayer)
      How to convert an image to be displayed to the user.