public class Compute extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Compute.Parameters |
| Constructor and Description |
|---|
Compute(IFunction operation)
Validate the {code operation}.
|
| Modifier and Type | Method and Description |
|---|---|
<O extends RealType<O>> |
cursor()
Returns a
Cursor with the same type as the first input image found. |
<C extends RealType<C>,O extends RealType<O>> |
cursor(C computeType,
O outputType) |
<C extends RealType<C>,O extends RealType<O>> |
cursor(Converter<RealType<?>,C> inConverter,
C computeType,
O outputType,
Converter<C,O> outConverter) |
<O extends RealType<O>> |
cursor(O outputType) |
<O extends RealType<O>> |
cursorDouble()
Returns a
Cursor with the same type as the first input image found. |
<O extends RealType<O>> |
cursorDouble(O outputType) |
<O extends RealType<O>> |
cursorDouble(O outputType,
Converter<RealType<?>,O> converter) |
<O extends RealType<O>> |
into(RandomAccessibleInterval<O> target)
Execute the computation and store the result into the
target. |
<O extends RealType<O>,C extends RealType<C>> |
into(RandomAccessibleInterval<O> target,
C computingType) |
<O extends RealType<O>,C extends RealType<C>> |
into(RandomAccessibleInterval<O> target,
Converter<RealType<?>,C> inConverter,
C computingType,
Converter<C,O> outConverter) |
<O extends RealType<O>,C extends RealType<C>> |
into(RandomAccessibleInterval<O> target,
Converter<RealType<?>,C> inConverter,
C computingType,
Converter<C,O> outConverter,
boolean printHierarchy)
Execute the mathematical operations and store the result into the given
RandomAccessibleInterval. |
<O extends RealType<O>> |
into(RandomAccessibleInterval<O> target,
Converter<RealType<?>,O> inConverter)
Execute the mathematical operations and store the result into the given
RandomAccessibleInterval. |
<O extends RealType<O> & NativeType<O>> |
intoArrayImg() |
<O extends RealType<O> & NativeType<O>,C extends RealType<C> & NativeType<C>> |
intoArrayImg(C computeType,
O outputType) |
<O extends RealType<O> & NativeType<O>,C extends RealType<C>> |
intoArrayImg(O outputType) |
<O extends RealType<O> & NativeType<O>> |
intoImg()
Execute the computation and store the result into a newly created
Img of the same Type
(and kind, by ImgFactory) as one of the input images, using as the computation Type
the type of that picked input image. |
<O extends RealType<O> & NativeType<O>,C extends RealType<C>> |
intoImg(C computeType,
O outputType)
Execute the computation and store the result into a newly created
Img of the same kind,
by ImgFactory, as one of the input images, but of type outputType, while using
computeType for math operations, converting to the outputType to store the result. |
<O extends RealType<O> & NativeType<O>> |
intoImg(O outputType)
Execute the computation and store the result into a newly created
Img of the same kind,
by ImgFactory, as one of the input images, but of type outputType, which is also
used as the computation Type. |
<O extends RealType<O>,C extends RealType<C>> |
parallelInto(Converter<RealType<?>,C> inConverter,
C computeType,
O outputType,
Converter<C,O> outConverter,
RandomAccessibleInterval<O> target)
Compute the result multithreaded into an
ArrayImg of the given Type. |
<O extends RealType<O>> |
parallelInto(RandomAccessibleInterval<O> target)
Compute the result multithreaded into an
ArrayImg of the given Type. |
<O extends RealType<O> & NativeType<O>> |
parallelIntoArrayImg()
Compute the result multithreaded into an
ArrayImg of the same Type as the first image found,
with mathematical operations using that same Type. |
<O extends RealType<O> & NativeType<O>,C extends RealType<C>> |
parallelIntoArrayImg(C computeType,
O outputType)
Compute the result multithreaded into an
ArrayImg of the given Type. |
<O extends RealType<O> & NativeType<O>,C extends RealType<C>> |
parallelIntoArrayImg(Converter<RealType<?>,C> inConverter,
C computeType,
O outputType,
Converter<C,O> outConverter)
Compute the result multithreaded into an
ArrayImg of the given Type. |
<O extends RealType<O> & NativeType<O>> |
parallelIntoArrayImg(O outputType)
Compute the result multithreaded into an
ArrayImg of the given Type. |
<O extends RealType<O>> |
randomAccess()
Returns a
RandomAccess with the same type as the first input image found. |
<C extends RealType<C>,O extends RealType<O>> |
randomAccess(C computeType,
O outputType,
Converter<C,O> outConverter) |
<C extends RealType<C>,O extends RealType<O>> |
randomAccess(Converter<RealType<?>,C> inConverter,
C computeType,
O outputType,
Converter<C,O> outConverter) |
<O extends RealType<O>> |
randomAccess(O outputType) |
<O extends RealType<O>> |
randomAccessDouble()
Returns a
RandomAccess with the same type as the first input image found. |
<O extends RealType<O>> |
randomAccessDouble(O outputType) |
<O extends RealType<O>> |
randomAccessDouble(O outputType,
Converter<RealType<?>,O> converter) |
static Compute.Parameters |
validate(IFunction f) |
<O extends RealType<O>> |
view() |
<O extends RealType<O>,C extends RealType<C>> |
view(C computingType,
O outputType)
View the result of the computations as a
RandomAccessibleInterval, i.e. |
<O extends RealType<O>> |
view(Interval interval) |
<O extends RealType<O>,C extends RealType<C>> |
view(Interval interval,
Converter<RealType<?>,C> inConverter,
C computingType,
O outputType,
Converter<C,O> outConverter) |
<O extends RealType<O>> |
view(Interval interval,
O outputType) |
<O extends RealType<O>> |
view(O outputType) |
public Compute(IFunction operation)
operation - public <O extends RealType<O> & NativeType<O>> ArrayImg<O,?> intoArrayImg()
public <O extends RealType<O> & NativeType<O>,C extends RealType<C> & NativeType<C>> ArrayImg<O,?> intoArrayImg(C computeType, O outputType)
public <O extends RealType<O> & NativeType<O>,C extends RealType<C>> ArrayImg<O,?> intoArrayImg(O outputType)
public <O extends RealType<O> & NativeType<O>> RandomAccessibleInterval<O> intoImg()
Img of the same Type
(and kind, by ImgFactory) as one of the input images, using as the computation Type
the type of that picked input image.
This approach is appropriate when e.g. all input images are of the same type, and operations aren't
expected to overflow the Type or it doesn't matter whether they do.Img with the result of the computation.public <O extends RealType<O> & NativeType<O>> RandomAccessibleInterval<O> intoImg(O outputType)
Img of the same kind,
by ImgFactory, as one of the input images, but of type outputType, which is also
used as the computation Type.outputType - The Type of the returned Img and used for computing.Img with the result of the computation.public <O extends RealType<O> & NativeType<O>,C extends RealType<C>> RandomAccessibleInterval<O> intoImg(C computeType, O outputType)
Img of the same kind,
by ImgFactory, as one of the input images, but of type outputType, while using
computeType for math operations, converting to the outputType to store the result.computeType - The Type used to perform mathematical operations.outputType - The Type of the returned Img.Img with the result of the computation.public <O extends RealType<O>> RandomAccessibleInterval<O> into(RandomAccessibleInterval<O> target)
target.
The computation is done using Type-based math, with the Type
of the target defining the specific math implementation and numerical
precision that will be used.target - The RandomAccessibleInterval into which to store the computation;
note its Type determines the precision of the computation and the specific
implementation of the mathematical operations.target.public <O extends RealType<O>> RandomAccessibleInterval<O> into(RandomAccessibleInterval<O> target, Converter<RealType<?>,O> inConverter)
RandomAccessibleInterval.target - The RandomAccessibleInterval into which to store the computation;
note its Type determines the precision of the computation and the specific
implementation of the mathematical operations.inConverter - The Converter that transfers all input Type to the Type
of the target; when null, will create one that uses double floating-point
precision; but note that if the Type of an input RandomAccessibleInterval
is the same as that of the target, the converter will not be used.target.public <O extends RealType<O>,C extends RealType<C>> RandomAccessibleInterval<O> into(RandomAccessibleInterval<O> target, C computingType)
public <O extends RealType<O>,C extends RealType<C>> RandomAccessibleInterval<O> into(RandomAccessibleInterval<O> target, Converter<RealType<?>,C> inConverter, C computingType, Converter<C,O> outConverter)
public <O extends RealType<O>,C extends RealType<C>> RandomAccessibleInterval<O> into(RandomAccessibleInterval<O> target, Converter<RealType<?>,C> inConverter, C computingType, Converter<C,O> outConverter, boolean printHierarchy)
RandomAccessibleInterval.
Takes into account whether all images involved in the computation are iterable in a compatible way.target - The RandomAccessibleInterval into which to store the computation.inConverter - The Converter that transfers all input Type to the Type
of the target; when null, will create one that uses double floating-point
precision; but note that if the Type of an input RandomAccessibleInterval
is the same as that of the target, the converter will not be used.computingType - The Type that determines the precision of the computation and the specific
implementation of the mathematical operations.outConverter - The Converter that transfers the computingType to the Type
of the target; will not be used if the computeType is the same as
the Type of the output; when null, a new one is created, which is the identity
when the computingType equal the Type of the target, and a generic
RealType converter that uses floating-point values (with RealType#setReal(double))
created with Util#genericRealTypeConverter() is used.printHierarchy - Emits to stdout the hierarchy of OFunction types.target.public <O extends RealType<O>,C extends RealType<C>> RandomAccessibleInterval<O> view(Interval interval, Converter<RealType<?>,C> inConverter, C computingType, O outputType, Converter<C,O> outConverter)
public <O extends RealType<O>,C extends RealType<C>> RandomAccessibleInterval<O> view(C computingType, O outputType)
RandomAccessibleInterval, i.e. there is no target image,
instead any pixel can be viewed as the result of the computation applied to it, dynamically.
Conversion between the input and computing type is done with an appropriate converter or none when types are the same.
See also ViewableFunction and methods below related to Compute#randomAccess() and Compute#cursor().
The key difference is that, here, the computing and the output type can be different.computingType - The Type that defines the math to use.outputType - The @{code Type} of the constructed and returned RandomAccessibleInterval.
return A RandomAccessibleInterval view of the result of the computations.public <O extends RealType<O>> RandomAccessibleInterval<O> view(O outputType)
public <O extends RealType<O>> RandomAccessibleInterval<O> view()
public <O extends RealType<O>> RandomAccessibleInterval<O> view(Interval interval)
public <O extends RealType<O>> RandomAccessibleInterval<O> view(Interval interval, O outputType)
public <O extends RealType<O> & NativeType<O>> RandomAccessibleInterval<O> parallelIntoArrayImg()
ArrayImg of the same Type as the first image found,
with mathematical operations using that same Type.public <O extends RealType<O> & NativeType<O>> RandomAccessibleInterval<O> parallelIntoArrayImg(O outputType)
ArrayImg of the given Type.outputType - The Type used for both computations and the output image.public <O extends RealType<O> & NativeType<O>,C extends RealType<C>> RandomAccessibleInterval<O> parallelIntoArrayImg(C computeType, O outputType)
ArrayImg of the given Type.
Uses generic RealType converters where appropriate as provided by Util#genericRealTypeConverter().computeType - The Type used for computations.outputType - The Type used for the output image.public <O extends RealType<O> & NativeType<O>,C extends RealType<C>> RandomAccessibleInterval<O> parallelIntoArrayImg(Converter<RealType<?>,C> inConverter, C computeType, O outputType, Converter<C,O> outConverter)
ArrayImg of the given Type.inConverter - From input to computeType, or when null, uses Util#genericRealTypeConverter().computeType - The Type used for computations.outputType - The Type used for the output image.outConverter - From computeType to outputType, or when null, uses Util#genericRealTypeConverter().public <O extends RealType<O>> RandomAccessibleInterval<O> parallelInto(RandomAccessibleInterval<O> target)
ArrayImg of the given Type.
Uses generic RealType converters where appropriate as provided by Util#genericRealTypeConverter().target - To store the result of the computation, with its Type defining both the output Type and the Type used for computations.public <O extends RealType<O>,C extends RealType<C>> RandomAccessibleInterval<O> parallelInto(Converter<RealType<?>,C> inConverter, C computeType, O outputType, Converter<C,O> outConverter, RandomAccessibleInterval<O> target)
ArrayImg of the given Type.inConverter - From input to computeType, or when null, uses Util#genericRealTypeConverter().computeType - The Type used for computations.outputType - The Type used for the output image.outConverter - From computeType to outputType, or when null, uses Util#genericRealTypeConverter().public static Compute.Parameters validate(IFunction f)
public <C extends RealType<C>,O extends RealType<O>> RandomAccess<O> randomAccess(Converter<RealType<?>,C> inConverter, C computeType, O outputType, Converter<C,O> outConverter)
public <C extends RealType<C>,O extends RealType<O>> RandomAccess<O> randomAccess(C computeType, O outputType, Converter<C,O> outConverter)
public <O extends RealType<O>> RandomAccess<O> randomAccess(O outputType)
public <O extends RealType<O>> RandomAccess<O> randomAccess()
RandomAccess with the same type as the first input image found.public <C extends RealType<C>,O extends RealType<O>> Cursor<O> cursor(Converter<RealType<?>,C> inConverter, C computeType, O outputType, Converter<C,O> outConverter)
public <C extends RealType<C>,O extends RealType<O>> Cursor<O> cursor(C computeType, O outputType)
public <O extends RealType<O>> Cursor<O> cursor()
Cursor with the same type as the first input image found.public <O extends RealType<O>> RandomAccess<O> randomAccessDouble(O outputType, Converter<RealType<?>,O> converter)
public <O extends RealType<O>> RandomAccess<O> randomAccessDouble(O outputType)
public <O extends RealType<O>> RandomAccess<O> randomAccessDouble()
RandomAccess with the same type as the first input image found.public <O extends RealType<O>> Cursor<O> cursorDouble(O outputType, Converter<RealType<?>,O> converter)
Copyright © 2015–2022 ImgLib2. All rights reserved.