Open ctrueden opened 8 years ago
i'm glad to contribute, the for cicle is to wrap the arrays from float to double, maybe repeating the code for float shall be enough.
@BishopWolf nice meeting you. Do you know about https://github.com/imagej/imagej-ops/blob/master/src/main/java/net/imagej/ops/stats/StatsNamespace.java?
I didnt know about that, I am currently doing this https://github.com/BishopWolf/NMQC/blob/master/src/main/java/utils/MathUtils.java do you have some advices on that, there we can give users a hint on what is the best practice on this
If your input is already IterableInterval
(e.g. an Img
or ImgPlus
are IterableInterval
s), then you can simply use our implementations e.g. by calling ops().stats().mean(...)
. We have some more features implemented, like haralick, zernike, 2d, 3d geometric features etc.
That only works for imageJ2, in that case the object is Img or ImgPlus. There is no support there for ImagePlus objects of ImageJ1. So if you are still there my way is the only solution ATM. I think this project shall be extended to include also ImagePlus, since they are used a lot! ImageJ1 is not dead yet ;)
There is no support there for ImagePlus objects of ImageJ1.
The Ops framework supports auto-conversion of types. So actually, you should be able to pass ImagePlus
objects, which will get auto-converted to Dataset
(and vice versa), because we have converters in both directions (1, 2). You just have to use ops().run(...)
instead of the type-safe signatures.
Apache Commons Math 3 has lots of neat statistics functions. We should glance over them, and decide whether it makes sense to wrap any of them as ops. They all operate on
double[]
objects.Here is an example script from @BishopWolf: