public interface OpEnvironment extends Contextual
OpRef
descriptors.
Customizing the OpEnvironment
allows customization of any or all of
the above. Potential use cases include:
The default—but not necessarily only—op environment is
the OpService
of the application. The environment can be modified by
using a CustomOpEnvironment
, or by implementing this interface
directly.
OpService
,
CustomOpEnvironment
Modifier and Type | Method and Description |
---|---|
default ColocNamespace |
coloc()
Gateway into ops of the "coloc" namespace.
|
default ConvertNamespace |
convert()
Gateway into ops of the "convert" namespace.
|
default CopyNamespace |
copy()
Gateway into ops of the "copy" namespace.
|
default CreateNamespace |
create()
Gateway into ops of the "create" namespace.
|
default DeconvolveNamespace |
deconvolve()
Gateway into ops of the "deconvolve" namespace.
|
default Object |
eval(String expression)
Executes the "eval" operation on the given arguments.
|
default Object |
eval(String expression,
Map<String,Object> vars)
Executes the "eval" operation on the given arguments.
|
default FilterNamespace |
filter()
Gateway into ops of the "filter" namespace.
|
default GeomNamespace |
geom()
Gateway into ops of the "geom" namespace.
|
default int |
getMaxThreads()
Gets the maximum number of threads any single op is allowed to use.
|
default HaralickNamespace |
haralick()
Gateway into ops of the "haralick" namespace.
|
default String |
help()
Executes the "help" operation on the given arguments.
|
default String |
help(Namespace namespace)
Executes the "help" operation on the given arguments.
|
default String |
help(Op op)
Executes the "help" operation on the given arguments.
|
default String |
help(String name)
Executes the "help" operation on the given arguments.
|
default String |
help(String name,
Class<? extends Op> opType)
Executes the "help" operation on the given arguments.
|
default String |
help(String name,
Class<? extends Op> opType,
Integer arity)
Executes the "help" operation on the given arguments.
|
default String |
help(String name,
Class<? extends Op> opType,
Integer arity,
SpecialOp.Flavor flavor)
Executes the "help" operation on the given arguments.
|
default <A> A |
identity(A arg)
Executes the "identity" operation on the given arguments.
|
default ImageNamespace |
image()
Gateway into ops of the "image" namespace.
|
default ImageMomentsNamespace |
imagemoments()
Gateway into ops of the "imagemoments" namespace.
|
OpInfo |
info(Class<? extends Op> type)
Gets the metadata for a given
Op class. |
default OpInfo |
info(Op op)
Gets the metadata for a given
Op . |
Collection<OpInfo> |
infos()
The available ops for the context, including those of the parent.
|
default <A> A |
join(A out,
A in,
List<? extends UnaryComputerOp<A,A>> ops,
UnaryOutputFactory<A,A> outputFactory)
Executes the "join" operation on the given arguments.
|
default <AI,AO extends AI,B> |
join(B out,
AO in,
UnaryInplaceOp<AI,AO> first,
UnaryComputerOp<AO,B> second)
Executes the "join" operation on the given arguments.
|
default <A,BI,BO extends BI> |
join(BO out,
A in,
UnaryComputerOp<A,BO> first,
UnaryInplaceOp<BI,BO> second)
Executes the "join" operation on the given arguments.
|
default <A,B,C> C |
join(C out,
A in,
UnaryComputerOp<A,B> first,
UnaryComputerOp<B,C> second,
UnaryOutputFactory<A,B> outputFactory)
Executes the "join" operation on the given arguments.
|
default <A,B extends A,C extends B> |
join(C arg,
UnaryInplaceOp<A,B> first,
UnaryInplaceOp<B,C> second)
Executes the "join" operation on the given arguments.
|
default <I,O extends I> |
join(O arg,
List<? extends UnaryInplaceOp<I,O>> ops)
Executes the "join" operation on the given arguments.
|
default LabelingNamespace |
labeling()
Gateway into ops of the "labeling" namespace.
|
default LBPNamespace |
lbp()
Gateway into ops of the "lbp" namespace.
|
default LinAlgNamespace |
linalg()
Gateway into ops of the "linalg" namespace
|
default LogicNamespace |
logic()
Gateway into ops of the "logic" namespace.
|
default <A> A |
loop(A out,
A in,
UnaryComputerOp<A,A> op,
UnaryOutputFactory<A,A> outputFactory,
int n)
Executes the "loop" operation on the given arguments.
|
default <I,O extends I> |
loop(O arg,
UnaryInplaceOp<I,O> op,
int n)
Executes the "loop" operation on the given arguments.
|
default <EI,EO> Iterable<EO> |
map(Iterable<EO> out,
Iterable<EI> in,
UnaryComputerOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EO> Iterable<EO> |
map(Iterable<EO> out,
NullaryComputerOp<EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO extends EI> |
map(Iterable<EO> arg,
UnaryInplaceOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO extends Type<EO>> |
map(IterableInterval<EI> input,
UnaryComputerOp<EI,EO> op,
EO type)
Executes the "map" operation on the given arguments.
|
default <EI,EO> IterableInterval<EO> |
map(IterableInterval<EO> out,
IterableInterval<EI> in,
UnaryComputerOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(IterableInterval<EO> out,
IterableInterval<EI1> in1,
IterableInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(IterableInterval<EO> out,
IterableInterval<EI1> in1,
RandomAccessibleInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO extends EI1> |
map(IterableInterval<EO> arg,
IterableInterval<EI2> in,
BinaryInplace1Op<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO extends EI> |
map(IterableInterval<EO> arg,
IterableInterval<EO> in,
BinaryInplaceOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EO> Iterable<EO> |
map(IterableInterval<EO> out,
NullaryComputerOp<EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO> IterableInterval<EO> |
map(IterableInterval<EO> out,
RandomAccessibleInterval<EI> in,
Shape shape,
CenterAwareComputerOp<EI,EO> func)
Executes the "map" operation on the given arguments.
|
default <EI,EO> IterableInterval<EO> |
map(IterableInterval<EO> out,
RandomAccessibleInterval<EI> in,
Shape shape,
UnaryComputerOp<Iterable<EI>,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO> IterableInterval<EO> |
map(IterableInterval<EO> out,
RandomAccessibleInterval<EI> in,
UnaryComputerOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(IterableInterval<EO> out,
RandomAccessibleInterval<EI1> in1,
IterableInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(IterableInterval<EO> out,
RandomAccessibleInterval<EI1> in1,
RandomAccessibleInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO extends EI1> |
map(IterableInterval<EO> arg,
RandomAccessibleInterval<EI2> in,
BinaryInplace1Op<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO extends EI> |
map(IterableInterval<EO> arg,
UnaryInplaceOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI,EO extends Type<EO>> |
map(RandomAccessible<EI> input,
UnaryComputerOp<EI,EO> op,
EO type)
Executes the "map" operation on the given arguments.
|
default <EI,EO extends Type<EO>> |
map(RandomAccessibleInterval<EI> input,
UnaryComputerOp<EI,EO> op,
EO type)
Executes the "map" operation on the given arguments.
|
default <EI,EO> RandomAccessibleInterval<EO> |
map(RandomAccessibleInterval<EO> out,
IterableInterval<EI> in,
UnaryComputerOp<EI,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(RandomAccessibleInterval<EO> out,
IterableInterval<EI1> in1,
IterableInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(RandomAccessibleInterval<EO> out,
IterableInterval<EI1> in1,
RandomAccessibleInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO extends EI1> |
map(RandomAccessibleInterval<EO> arg,
IterableInterval<EI2> in,
BinaryInplace1Op<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
default <EI1,EI2,EO> |
map(RandomAccessibleInterval<EO> out,
RandomAccessibleInterval<EI1> in1,
IterableInterval<EI2> in2,
BinaryComputerOp<EI1,EI2,EO> op)
Executes the "map" operation on the given arguments.
|
OpMatchingService |
matcher() |
default MathNamespace |
math()
Gateway into ops of the "math" namespace.
|
default Module |
module(Class<? extends Op> type,
Object... args)
|
default Module |
module(Op op,
Object... args)
|
default Module |
module(String name,
Object... args)
|
default MorphologyNamespace |
morphology()
Gateway into ops of the "morphology" namespace.
|
<NS extends Namespace> |
namespace(Class<NS> nsClass)
Gets the namespace of the given class.
|
default <OP extends Op> |
op(Class<OP> type,
Object... args)
Gets the best
Op to use for the given operation type and arguments,
populating its inputs. |
default Op |
op(List<OpRef> refs)
Looks up an op whose constraints are specified by the given list of
OpRef descriptor. |
default Op |
op(OpRef ref)
Looks up an op whose constraints are specified by the given
OpRef
descriptor. |
default Op |
op(String name,
Object... args)
Gets the best
Op to use for the given operation and arguments,
populating its inputs. |
default Collection<String> |
ops()
Gets the fully qualified names of all available operations.
|
default OpEnvironment |
parent()
The parent context, if any.
|
default Object |
run(Class<? extends Op> type,
Object... args)
Executes the operation of the given type with the specified arguments.
|
static Object |
run(Module module) |
default Object |
run(Op op,
Object... args)
Executes the given
Op with the specified arguments. |
default Object |
run(String name,
Object... args)
Executes the given operation with the specified arguments.
|
default void |
setMaxThreads(int maxThreads)
Sets the maximum number of threads any single op is allowed to use.
|
default <I,O> RandomAccessibleInterval<O> |
slice(RandomAccessibleInterval<O> out,
RandomAccessibleInterval<I> in,
UnaryComputerOp<RandomAccessibleInterval<I>,RandomAccessibleInterval<O>> op,
int... axisIndices)
Executes the "slicewise" operation on the given arguments.
|
default <I,O> RandomAccessibleInterval<O> |
slice(RandomAccessibleInterval<O> out,
RandomAccessibleInterval<I> in,
UnaryComputerOp<RandomAccessibleInterval<I>,RandomAccessibleInterval<O>> op,
int[] axisIndices,
boolean dropSingleDimensions)
Executes the "slicewise" operation on the given arguments.
|
default StatsNamespace |
stats()
Gateway into ops of the "stats" namespace.
|
default TamuraNamespace |
tamura()
Gateway into ops of the "tamura" namespace.
|
default ThreadNamespace |
thread()
Gateway into ops of the "thread" namespace.
|
default ThresholdNamespace |
threshold()
Gateway into ops of the "threshold" namespace.
|
default TopologyNamespace |
topology()
Gateway into ops of the "topology" namespace
|
default TransformNamespace |
transform()
Gateway into ops of the "transform" namespace.
|
default ZernikeNamespace |
zernike()
Gateway into ops of the "zernike" namespace.
|
context, getContext, setContext
OpMatchingService matcher()
default Object run(String name, Object... args)
Op
implementation to use will be selected automatically from the
operation name and arguments.name
- The operation to execute. If multiple Op
s share this
name, then the best Op
implementation to use will be
selected automatically from the name and arguments. If a name
without namespace is given, then ops from all namespaces with that
name will be included in the match; e.g., "and"
will match
both "logic.and"
and "math.and"
ops.args
- The operation's arguments.Op
has no outputs, this
will return null
. If exactly one output, it will be
returned verbatim. If more than one, a List<Object>
of the
outputs will be given.default Object run(Class<? extends Op> type, Object... args)
Op
implementation to use will be selected automatically from
the operation type and arguments.type
- The Class
of the operation to execute. If multiple
Op
s share this type (e.g., the type is an interface which
multiple Op
s implement), then the best Op
implementation to use will be selected automatically from the type
and arguments.args
- The operation's arguments.Op
has no outputs, this
will return null
. If exactly one output, it will be
returned verbatim. If more than one, a List<Object>
of the
outputs will be given.default Op op(String name, Object... args)
Op
to use for the given operation and arguments,
populating its inputs.default <OP extends Op> OP op(Class<OP> type, Object... args)
Op
to use for the given operation type and arguments,
populating its inputs.type
- The Class
of the operation. If multiple Op
s
share this type (e.g., the type is an interface which multiple
Op
s implement), then the best Op
implementation to
use will be selected automatically from the type and arguments.args
- The operation's arguments.Op
with populated inputs, ready to run.default Op op(OpRef ref)
OpRef
descriptor.
NB: While it is typically the case that the returned Op
instance is
of the requested type(s), it may differ in certain circumstances. For
example, the CachedOpEnvironment
wraps the matching Op
instance in some cases so that the values it computes can be cached for
performance reasons.
ref
- The OpRef
describing the op to match.default Op op(List<OpRef> refs)
OpRef
descriptor.
NB: While it is typically the case that the returned Op
instance is
of the requested type(s), it may differ in certain circumstances. For
example, the CachedOpEnvironment
wraps the matching Op
instance in some cases so that the values it computes can be cached for
performance reasons.
refs
- The list of OpRef
s describing the op to match.default Module module(Class<? extends Op> type, Object... args)
Op
to use for the given operation type and arguments,
wrapping it as a Module
with populated inputs.type
- The required type of the operation. If multiple Op
s
share this type (e.g., the type is an interface which multiple
Op
s implement), then the best Op
implementation to
use will be selected automatically from the type and arguments.args
- The operation's arguments.Module
wrapping the best Op
, with populated
inputs, ready to run.Collection<OpInfo> infos()
parent()
default Collection<String> ops()
default OpEnvironment parent()
<NS extends Namespace> NS namespace(Class<NS> nsClass)
default int getMaxThreads()
default void setMaxThreads(int maxThreads)
default Object eval(String expression, Map<String,Object> vars)
default String help()
default String help(String name, Class<? extends Op> opType)
default String help(String name, Class<? extends Op> opType, Integer arity)
default String help(String name, Class<? extends Op> opType, Integer arity, SpecialOp.Flavor flavor)
default <A> A identity(A arg)
default <A,B,C> C join(C out, A in, UnaryComputerOp<A,B> first, UnaryComputerOp<B,C> second, UnaryOutputFactory<A,B> outputFactory)
default <A,B extends A,C extends B> C join(C arg, UnaryInplaceOp<A,B> first, UnaryInplaceOp<B,C> second)
default <A> A join(A out, A in, List<? extends UnaryComputerOp<A,A>> ops, UnaryOutputFactory<A,A> outputFactory)
default <I,O extends I> O join(O arg, List<? extends UnaryInplaceOp<I,O>> ops)
default <AI,AO extends AI,B> B join(B out, AO in, UnaryInplaceOp<AI,AO> first, UnaryComputerOp<AO,B> second)
default <A,BI,BO extends BI> BO join(BO out, A in, UnaryComputerOp<A,BO> first, UnaryInplaceOp<BI,BO> second)
default <I,O extends I> O loop(O arg, UnaryInplaceOp<I,O> op, int n)
default <A> A loop(A out, A in, UnaryComputerOp<A,A> op, UnaryOutputFactory<A,A> outputFactory, int n)
default <EO> Iterable<EO> map(Iterable<EO> out, NullaryComputerOp<EO> op)
default <EO> Iterable<EO> map(IterableInterval<EO> out, NullaryComputerOp<EO> op)
default <EI,EO> IterableInterval<EO> map(IterableInterval<EO> out, IterableInterval<EI> in, UnaryComputerOp<EI,EO> op)
default <EI,EO> RandomAccessibleInterval<EO> map(RandomAccessibleInterval<EO> out, IterableInterval<EI> in, UnaryComputerOp<EI,EO> op)
default <EI,EO> IterableInterval<EO> map(IterableInterval<EO> out, RandomAccessibleInterval<EI> in, UnaryComputerOp<EI,EO> op)
default <EI1,EI2,EO> IterableInterval<EO> map(IterableInterval<EO> out, IterableInterval<EI1> in1, IterableInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI1,EI2,EO> RandomAccessibleInterval<EO> map(RandomAccessibleInterval<EO> out, IterableInterval<EI1> in1, IterableInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI1,EI2,EO> IterableInterval<EO> map(IterableInterval<EO> out, IterableInterval<EI1> in1, RandomAccessibleInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI1,EI2,EO> RandomAccessibleInterval<EO> map(RandomAccessibleInterval<EO> out, IterableInterval<EI1> in1, RandomAccessibleInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI1,EI2,EO> IterableInterval<EO> map(IterableInterval<EO> out, RandomAccessibleInterval<EI1> in1, IterableInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI1,EI2,EO> RandomAccessibleInterval<EO> map(RandomAccessibleInterval<EO> out, RandomAccessibleInterval<EI1> in1, IterableInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI1,EI2,EO> IterableInterval<EO> map(IterableInterval<EO> out, RandomAccessibleInterval<EI1> in1, RandomAccessibleInterval<EI2> in2, BinaryComputerOp<EI1,EI2,EO> op)
default <EI,EO extends Type<EO>> RandomAccessibleInterval<EO> map(RandomAccessibleInterval<EI> input, UnaryComputerOp<EI,EO> op, EO type)
default <EI,EO extends Type<EO>> RandomAccessible<EO> map(RandomAccessible<EI> input, UnaryComputerOp<EI,EO> op, EO type)
default <EI,EO extends Type<EO>> IterableInterval<EO> map(IterableInterval<EI> input, UnaryComputerOp<EI,EO> op, EO type)
default <EI,EO extends EI> IterableInterval<EO> map(IterableInterval<EO> arg, UnaryInplaceOp<EI,EO> op)
default <EI,EO extends EI> Iterable<EO> map(Iterable<EO> arg, UnaryInplaceOp<EI,EO> op)
default <EI,EO> IterableInterval<EO> map(IterableInterval<EO> out, RandomAccessibleInterval<EI> in, Shape shape, UnaryComputerOp<Iterable<EI>,EO> op)
default <EI,EO> IterableInterval<EO> map(IterableInterval<EO> out, RandomAccessibleInterval<EI> in, Shape shape, CenterAwareComputerOp<EI,EO> func)
default <EI,EO> Iterable<EO> map(Iterable<EO> out, Iterable<EI> in, UnaryComputerOp<EI,EO> op)
default <EI,EO extends EI> IterableInterval<EO> map(IterableInterval<EO> arg, IterableInterval<EO> in, BinaryInplaceOp<EI,EO> op)
default <EI1,EI2,EO extends EI1> IterableInterval<EO> map(IterableInterval<EO> arg, IterableInterval<EI2> in, BinaryInplace1Op<EI1,EI2,EO> op)
default <EI1,EI2,EO extends EI1> IterableInterval<EO> map(IterableInterval<EO> arg, RandomAccessibleInterval<EI2> in, BinaryInplace1Op<EI1,EI2,EO> op)
default <EI1,EI2,EO extends EI1> RandomAccessibleInterval<EO> map(RandomAccessibleInterval<EO> arg, IterableInterval<EI2> in, BinaryInplace1Op<EI1,EI2,EO> op)
default <I,O> RandomAccessibleInterval<O> slice(RandomAccessibleInterval<O> out, RandomAccessibleInterval<I> in, UnaryComputerOp<RandomAccessibleInterval<I>,RandomAccessibleInterval<O>> op, int... axisIndices)
default <I,O> RandomAccessibleInterval<O> slice(RandomAccessibleInterval<O> out, RandomAccessibleInterval<I> in, UnaryComputerOp<RandomAccessibleInterval<I>,RandomAccessibleInterval<O>> op, int[] axisIndices, boolean dropSingleDimensions)
default ColocNamespace coloc()
default CopyNamespace copy()
default ConvertNamespace convert()
default CreateNamespace create()
default DeconvolveNamespace deconvolve()
default FilterNamespace filter()
default GeomNamespace geom()
default HaralickNamespace haralick()
default ImageNamespace image()
default ImageMomentsNamespace imagemoments()
default LabelingNamespace labeling()
default LBPNamespace lbp()
default LinAlgNamespace linalg()
default LogicNamespace logic()
default MathNamespace math()
default MorphologyNamespace morphology()
default StatsNamespace stats()
default TamuraNamespace tamura()
default ThreadNamespace thread()
default ThresholdNamespace threshold()
default TopologyNamespace topology()
default TransformNamespace transform()
default ZernikeNamespace zernike()
Copyright © 2014–2022 ImageJ. All rights reserved.