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}.
|
public Compute(IFunction operation)
operation - public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>> net.imglib2.img.array.ArrayImg<O,?> intoArrayImg()
public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>,C extends net.imglib2.type.numeric.RealType<C> & net.imglib2.type.NativeType<C>> net.imglib2.img.array.ArrayImg<O,?> intoArrayImg(C computeType, O outputType)
public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.img.array.ArrayImg<O,?> intoArrayImg(O outputType)
public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>> net.imglib2.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 net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>> net.imglib2.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 net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.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 net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> into(net.imglib2.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 net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> into(net.imglib2.RandomAccessibleInterval<O> target, net.imglib2.converter.Converter<net.imglib2.type.numeric.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 net.imglib2.type.numeric.RealType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.RandomAccessibleInterval<O> into(net.imglib2.RandomAccessibleInterval<O> target, C computingType)
public <O extends net.imglib2.type.numeric.RealType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.RandomAccessibleInterval<O> into(net.imglib2.RandomAccessibleInterval<O> target, net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computingType, net.imglib2.converter.Converter<C,O> outConverter)
public <O extends net.imglib2.type.numeric.RealType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.RandomAccessibleInterval<O> into(net.imglib2.RandomAccessibleInterval<O> target, net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computingType, net.imglib2.converter.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 net.imglib2.type.numeric.RealType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.RandomAccessibleInterval<O> view(net.imglib2.Interval interval, net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computingType, O outputType, net.imglib2.converter.Converter<C,O> outConverter)
public <O extends net.imglib2.type.numeric.RealType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.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 net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> view(O outputType)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> view()
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> view(net.imglib2.Interval interval)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> view(net.imglib2.Interval interval, O outputType)
public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>> net.imglib2.RandomAccessibleInterval<O> parallelIntoArrayImg()
ArrayImg of the same Type as the first image found,
with mathematical operations using that same Type.public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>> net.imglib2.RandomAccessibleInterval<O> parallelIntoArrayImg(O outputType)
ArrayImg of the given Type.outputType - The Type used for both computations and the output image.public <O extends net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.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 net.imglib2.type.numeric.RealType<O> & net.imglib2.type.NativeType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.RandomAccessibleInterval<O> parallelIntoArrayImg(net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computeType, O outputType, net.imglib2.converter.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 net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccessibleInterval<O> parallelInto(net.imglib2.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 net.imglib2.type.numeric.RealType<O>,C extends net.imglib2.type.numeric.RealType<C>> net.imglib2.RandomAccessibleInterval<O> parallelInto(net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computeType, O outputType, net.imglib2.converter.Converter<C,O> outConverter, net.imglib2.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 net.imglib2.type.numeric.RealType<C>,O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccess(net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computeType, O outputType, net.imglib2.converter.Converter<C,O> outConverter)
public <C extends net.imglib2.type.numeric.RealType<C>,O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccess(C computeType, O outputType, net.imglib2.converter.Converter<C,O> outConverter)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccess(O outputType)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccess()
RandomAccess with the same type as the first input image found.public <C extends net.imglib2.type.numeric.RealType<C>,O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursor(net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,C> inConverter, C computeType, O outputType, net.imglib2.converter.Converter<C,O> outConverter)
public <C extends net.imglib2.type.numeric.RealType<C>,O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursor(C computeType, O outputType)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursor(O outputType)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursor()
Cursor with the same type as the first input image found.public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccessDouble(O outputType, net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,O> converter)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccessDouble(O outputType)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.RandomAccess<O> randomAccessDouble()
RandomAccess with the same type as the first input image found.public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursorDouble(O outputType, net.imglib2.converter.Converter<net.imglib2.type.numeric.RealType<?>,O> converter)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursorDouble(O outputType)
public <O extends net.imglib2.type.numeric.RealType<O>> net.imglib2.Cursor<O> cursorDouble()
Cursor with the same type as the first input image found.Copyright © 2009–2025 ImgLib2. All rights reserved.