public abstract class ExplicitDiffusionScheme<T extends RealType<T>> extends MultiThreadedBenchmarkAlgorithm
Modifier and Type | Field and Description |
---|---|
protected RandomAccessibleInterval<FloatType> |
D
The diffusion tensor.
|
protected ImgFactory<FloatType> |
imgFactory |
protected Img<FloatType> |
increment
This is a temporary holder were we store the increment to add to the
input image at each iteration.
|
protected RandomAccessibleInterval<T> |
input
The input image, will be modified by this algorithm.
|
protected int |
tensorComponentDimension
The dimension to iterate over to retrieve the tensor components.
|
processingTime
errorMessage, numThreads
Constructor and Description |
---|
ExplicitDiffusionScheme(Img<T> input,
Img<FloatType> D)
Contructor of ExplicitDiffusionScheme, calls contructor
ExplicitDiffusionScheme(RandomAccessibleInterval<T>,
RandomAccessibleInterval<FloatType>, ImgFactory<FloatType>) and uses the
ImgFactory of the second Img as third parameter. |
ExplicitDiffusionScheme(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<FloatType> D)
Contructor of ExplicitDiffusionScheme, calls contructor
ExplicitDiffusionScheme(RandomAccessibleInterval<T>,
RandomAccessibleInterval<FloatType>, ImgFactory<FloatType>) and uses a default
ArrayImgFactory<FloatType> or CellImgFactory<FloatType> as third parameter
(depends on size of input). |
ExplicitDiffusionScheme(RandomAccessibleInterval<T> input,
RandomAccessibleInterval<FloatType> D,
ImgFactory<FloatType> imgFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkInput() |
protected abstract float |
diffusionScheme(float[] U,
float[][] D)
Compute the float increment of the current location, for which is given
the density neighborhood and the diffusion tensor neighborhood.
|
RandomAccessibleInterval<FloatType> |
getDiffusionTensor() |
RandomAccessibleInterval<FloatType> |
getIncrement() |
protected abstract float[] |
initDensityArray() |
protected abstract float[][] |
initDiffusionTensorArray() |
boolean |
process()
Execute one iteration of explicit scheme of the diffusion equation.
|
void |
setDiffusionTensor(RandomAccessibleInterval<FloatType> D)
Set the diffusion tensor that will be used for the diffusion process.
|
protected abstract void |
yieldDensity(RandomAccess<T> ura,
float[] target)
Iterate over a nD equivalent of 3x3 neighborhood, and collect the input
values needed in that neighborhood to compute the concrete diffusion
scheme.
|
protected abstract void |
yieldDiffusionTensor(RandomAccess<FloatType> dra,
float[][] target)
Iterate over a nD equivalent of 3x3 neighborhood, and collect the
diffusion tensor values needed in that neighborhood to compute the
concrete diffusion scheme.
|
getProcessingTime
getErrorMessage, getNumThreads, setNumThreads, setNumThreads
protected RandomAccessibleInterval<FloatType> D
protected final RandomAccessibleInterval<T extends RealType<T>> input
protected Img<FloatType> increment
dt
times the right-hand-size of the diffusion equation.protected ImgFactory<FloatType> imgFactory
protected final int tensorComponentDimension
public ExplicitDiffusionScheme(Img<T> input, Img<FloatType> D)
ExplicitDiffusionScheme(RandomAccessibleInterval<T>,
RandomAccessibleInterval<FloatType>, ImgFactory<FloatType>)
and uses the
ImgFactory
of the second Img as third parameter.input
- the input ImgD
- the diffusion tensorpublic ExplicitDiffusionScheme(RandomAccessibleInterval<T> input, RandomAccessibleInterval<FloatType> D)
ExplicitDiffusionScheme(RandomAccessibleInterval<T>,
RandomAccessibleInterval<FloatType>, ImgFactory<FloatType>)
and uses a default
ArrayImgFactory<FloatType>
or CellImgFactory<FloatType>
as third parameter
(depends on size of input).input
- the input ImgD
- the diffusion tensorpublic ExplicitDiffusionScheme(RandomAccessibleInterval<T> input, RandomAccessibleInterval<FloatType> D, ImgFactory<FloatType> imgFactory)
protected abstract float[] initDensityArray()
protected abstract float[][] initDiffusionTensorArray()
public boolean process()
public RandomAccessibleInterval<FloatType> getIncrement()
dt
times the right-hand-size
of the diffusion equation.protected abstract float diffusionScheme(float[] U, float[][] D)
U
- the density neighborhoodD
- the diffusion tensor neighborhoodyieldDensity(RandomAccess, float[])
,
yieldDiffusionTensor(RandomAccess, float[][])
public boolean checkInput()
public void setDiffusionTensor(RandomAccessibleInterval<FloatType> D)
The diffusion tensor must be a FloatType
RandomAccessibleInterval
, with specific dimensions: If the target
image has N
dimensions, the tensor must have
N+1
dimensions with:
N
dimensions size equal to the input size;
N+1
dimension having a size of 3.
The tensor stores the local diffusion intensity and orientation in the
shape of a real symmetric 2x2
matrix. Along the
N+1
dimension, the tensor components are ordered as:
Dxx
Dxy
Dyy
public RandomAccessibleInterval<FloatType> getDiffusionTensor()
getDiffusionTensor()
protected abstract void yieldDensity(RandomAccess<T> ura, float[] target)
ura
- the RandomAccess
target
- the float array in which the value will be storedprotected abstract void yieldDiffusionTensor(RandomAccess<FloatType> dra, float[][] target)
dra
- the RandomAccess
target
- the float array in which the value will be storedCopyright © 2015–2022 ImgLib2. All rights reserved.