//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@7b00c550
This Op
calculates the Third Moment About the Mean of any Iterable
, using the mean
and size
Op
s. The Third Moment About the Mean is closely related to the Skewness of a distribution, where if μ3
is the Third Moment About the Mean and σ
is the Standard Deviation, then skewness = μ3 / (σ * σ * σ)
.
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 moment3AboutMean()
:
import net.imglib2.type.numeric.real.DoubleType
output = new DoubleType()
ij.op().stats().moment3AboutMean(output, sinusoid32)
output
-10221.960619118927