T
- S
- public abstract class ROIAlgorithm<T extends RealType<T>,S extends RealType<S>> extends Object implements OutputAlgorithm<S>, Benchmark
RegionOfInterestCursor
from the input image, and an output image, which is
assumed to be of the same size as the input. The process() method curses over the output image,
and at each step calls the abstract method patchOperation(), giving it the current location in
the output and input images, as well as the RegionOfInterestCursor, which will curse over a
patch of a given size in the input image. patchOperation() is responsible for setting the
value of the pixel at the given position in the output image.Modifier | Constructor and Description |
---|---|
protected |
ROIAlgorithm(S type,
Image<T> imageIn,
int[] patchSize)
Creates an ROIAlgorithm with default
OutOfBoundsStrategyValueFactory , with value
Zero. |
protected |
ROIAlgorithm(S type,
Image<T> imageIn,
int[] patchSize,
OutOfBoundsStrategyFactory<T> inOutFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkInput() |
void |
close() |
String |
getErrorMessage() |
String |
getName() |
protected Image<S> |
getOutputImage()
Returns the
Image that will eventually become the result of this
OutputAlgorithm , and creates it if it has not yet been created. |
int[] |
getPatchSize() |
long |
getProcessingTime() |
Image<S> |
getResult() |
protected abstract boolean |
patchOperation(int[] position,
RegionOfInterestCursor<T> cursor)
Performs this algorithm's operation on the patch represented by a
RegionOfInterestCursor |
protected int[] |
positionOffset(int[] position,
int[] offsetPosition)
Offsets the given position to reflect the origin of the patch being in its center, rather
than at the top-left corner as is usually the case.
|
boolean |
process() |
protected void |
setErrorMessage(String message) |
void |
setImageFactory(ImageFactory<S> factory)
Set the
ImageFactory used to create the output Image |
void |
setName(String inName)
Set the name given to the output image.
|
protected ROIAlgorithm(S type, Image<T> imageIn, int[] patchSize)
OutOfBoundsStrategyValueFactory
, with value
Zero.type
- a representative type for the output image.imageIn
- the image over which to iterate.patchSize
- the size of the patch that will be examined at each iteration.protected ROIAlgorithm(S type, Image<T> imageIn, int[] patchSize, OutOfBoundsStrategyFactory<T> inOutFactory)
type
- a representative type for the output image.imageIn
- the image over which to iterate.patchSize
- the size of the patch that will be examined at each iteration.inOutFactory
- an OutOfBoundsStrategyFactory
to handle the border phenomenon.protected abstract boolean patchOperation(int[] position, RegionOfInterestCursor<T> cursor)
RegionOfInterestCursor
position
- the position in the input image at the center of the patch represented by
the RegionOfInterestCursorcursor
- a RegionOfInterestCursor
that iterates over the given
patch-of-interestpublic void setImageFactory(ImageFactory<S> factory)
ImageFactory
used to create the output Image
factory
- the ImageFactory
used to create the output Image
public void setName(String inName)
inName
- the name to give to the output image.public String getName()
public int[] getPatchSize()
protected Image<S> getOutputImage()
Image
that will eventually become the result of this
OutputAlgorithm
, and creates it if it has not yet been created.Image
that will eventually become the result of this
OutputAlgorithm
.public Image<S> getResult()
getResult
in interface OutputAlgorithm<S extends RealType<S>>
public String getErrorMessage()
getErrorMessage
in interface Algorithm
protected void setErrorMessage(String message)
protected int[] positionOffset(int[] position, int[] offsetPosition)
position
- the position to be offsetoffsetPosition
- an int array to contain the newly offset position coordinatespublic boolean checkInput()
checkInput
in interface Algorithm
public void close()
public long getProcessingTime()
getProcessingTime
in interface Benchmark
Copyright © 2015–2021 Fiji. All rights reserved.