T
- tensor-type inputted and outputted to modelS
- model-typepublic abstract class SegmentStackIntoObjectsScaleDecode<T,S extends ImageInferenceModel<T>> extends SegmentStackIntoObjectsPooled<S>
SegmentStackIntoObjectsScaleDecode
that scales the input image, before performing
inference, and then decodes the output.Constructor and Description |
---|
SegmentStackIntoObjectsScaleDecode() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
deriveInput(Stack stack,
Optional<double[]> subtractMeans)
Derives the input tensor from an image.
|
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.
|
DecodeInstanceSegmentation<T> |
getDecode()
Decodes inference output into segmented objects.
|
StackDisplayer |
getDisplayer()
How to convert an image to be displayed to the user.
|
Interpolator |
getInterpolator()
The interpolator to use for scaling images.
|
ScaleCalculator |
getScaleInput()
Any scaling to be applied to the input-image before being input to the model for inference.
|
DoubleList |
getSubtractMean()
A constant intensity for each respective channel to be subtracted before performing
inference.
|
protected abstract Optional<String> |
inputName()
The name of the tensor in the model which the input-image is mapped to.
|
SegmentedObjects |
segment(Stack stack,
ConcurrentModelPool<S> modelPool,
ExecutionTimeRecorder executionTimeRecorder)
Segments a stack to produce an object-collection.
|
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.
|
void |
setDecode(DecodeInstanceSegmentation<T> decode)
Decodes inference output into segmented objects.
|
void |
setDisplayer(StackDisplayer displayer)
How to convert an image to be displayed to the user.
|
void |
setInterpolator(Interpolator interpolator)
The interpolator to use for scaling images.
|
void |
setScaleInput(ScaleCalculator scaleInput)
Any scaling to be applied to the input-image before being input to the model for inference.
|
void |
setSubtractMean(DoubleList subtractMean)
A constant intensity for each respective channel to be subtracted before performing
inference.
|
createModelPool, resolve, segment
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public SegmentedObjects segment(Stack stack, ConcurrentModelPool<S> modelPool, ExecutionTimeRecorder executionTimeRecorder) throws SegmentationFailedException
SegmentStackIntoObjectsPooled
Any created objects will always exist inside the stack's Extent
.
segment
in class SegmentStackIntoObjectsPooled<S extends ImageInferenceModel<T>>
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.SegmentationFailedException
- if anything goes wrong during the segmentation.protected abstract T deriveInput(Stack stack, Optional<double[]> subtractMeans) throws OperationFailedException
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).OperationFailedException
- if an input tensor cannot be created.protected abstract Optional<String> inputName()
public ScaleCalculator getScaleInput()
public void setScaleInput(ScaleCalculator scaleInput)
public DecodeInstanceSegmentation<T> getDecode()
public void setDecode(DecodeInstanceSegmentation<T> decode)
public DoubleList getSubtractMean()
If set, this should create an list, with as many elements as channels inputted to the inference model.
public void setSubtractMean(DoubleList subtractMean)
If set, this should create an list, with as many elements as channels inputted to the inference model.
public String getClassLabelsPath()
If empty, then no such file is specified.
public void setClassLabelsPath(String classLabelsPath)
If empty, then no such file is specified.
public Interpolator getInterpolator()
public void setInterpolator(Interpolator interpolator)
public StackDisplayer getDisplayer()
public void setDisplayer(StackDisplayer displayer)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.