While testing SciJavaOps in the Fiji script editor (using Jython) I discovered that I was unable to use the "math.subtract" op to subtract two images from each other.
Here is a minimal example you can run with an open 2D image in Fiji:
#@ Img img_in
# get op environoment
from org.scijava.ops.api import OpEnvironment
ops = OpEnvironment.getEnvironment()
# create gauss blur of image
gauss = ops.op("filter.gauss").arity2().input(img_in, 3.0).apply()
# subtract gauss blur from input image
res = ops.op("math.subtract").arity2().input(img_in, gauss).apply()
This produces the following output:
...
... 24 more
Suppressed: org.scijava.ops.api.features.OpMatchingException: No matching 'math.subtract/java.util.function.BiFunction<net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, java.lang.Object>' op
Request:
- Name: "math.subtract", Types: java.util.function.BiFunction<net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, java.lang.Object>
Input Types:
* net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>
* net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>
Output Type:
* java.lang.Object
Candidates:
- No candidates found!
at org.scijava.ops.api.features.MatchingResult.singleMatch(MatchingResult.java:67)
at org.scijava.ops.engine.matcher.impl.RuntimeSafeMatchingRoutine.findMatch(RuntimeSafeMatchingRoutine.java:60)
at org.scijava.ops.api.features.MatchingRoutine.match(MatchingRoutine.java:43)
at org.scijava.ops.engine.matcher.impl.DefaultOpMatcher.match(DefaultOpMatcher.java:66)
... 36 more
Suppressed: org.scijava.ops.api.features.OpMatchingException: Unable to find an Op adaptation for org.scijava.ops.api.features.MatchingConditions@14eb64f2
at org.scijava.ops.engine.matcher.adapt.AdaptationMatchingRoutine.findMatch(AdaptationMatchingRoutine.java:157)
at org.scijava.ops.api.features.MatchingRoutine.match(MatchingRoutine.java:43)
at org.scijava.ops.engine.matcher.impl.DefaultOpMatcher.match(DefaultOpMatcher.java:66)
... 36 more
Suppressed: org.scijava.ops.api.features.OpMatchingException: No matching 'math.subtract/java.util.function.BiFunction<net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, java.lang.Object>' op
Request:
- Name: "math.subtract", Types: java.util.function.BiFunction<net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>, java.lang.Object>
Input Types:
* net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>
* net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedShortType>
Output Type:
* java.lang.Object
Candidates:
- No candidates found!
at org.scijava.ops.api.features.MatchingResult.singleMatch(MatchingResult.java:67)
at org.scijava.ops.engine.matcher.impl.RuntimeSafeMatchingRoutine.findMatch(RuntimeSafeMatchingRoutine.java:60)
at org.scijava.ops.api.features.MatchingRoutine.match(MatchingRoutine.java:43)
at org.scijava.ops.engine.matcher.impl.DefaultOpMatcher.match(DefaultOpMatcher.java:66)
... 36 more
While testing SciJavaOps in the Fiji script editor (using Jython) I discovered that I was unable to use the
"math.subtract"op to subtract two images from each other.Here is a minimal example you can run with an open 2D image in Fiji:
This produces the following output: