//load ImageJ
%classpath config resolver imagej.public https://maven.imagej.net/content/groups/public
%classpath add mvn net.imagej imagej 2.0.0-rc-67
//create ImageJ object
ij = new net.imagej.ImageJ()
Added new repo: imagej.public
net.imagej.ImageJ@7e81177
This Op
calculates the sum of all of the values of any Iterable
. This Op
is used by many other stats
Op
s.
sinusoid32 = ij.op().run("create.img", [150, 100])
formula = "63 * (Math.cos(0.3*p[0]) + Math.sin(0.3*p[1])) + 127"
ij.op().image().equation(sinusoid32, formula)
ij.notebook().display(sinusoid32)
All Img
s are Iterable
s, so we can just pass through the Img
to sum()
:
import net.imglib2.type.numeric.real.DoubleType
output = new DoubleType()
ij.op().stats().sum(output, sinusoid32)
output
1955339.4112892165