First Order Statistical Analysis


I am a veterinary radiologist and am doing a research project using ultrasound imaging and assessing the ultrasound heterogeneity of the pancreas. I am new to texture analysis, but have assistance from someone with more experience on using ImageJ. I will have several static images of the pancreas to analyse.

I am using the standard ImageJ platform to calculate the first order (histogram) analysis of a ROI on the image. This includes mean grey value, variance, skewness, and kurtosis. However, I am interested in energy and entropy values and wonder if anyone can help me in getting these values (formula/code?). At this stage I would like to use first order analysis, and then will look at progressing to second order GSCM and RLM analysis.

Can anyone help me with this?

Thank you


Have a look at this older thread:

Thanks Bio7

I looked at that thread and have attempted to navigate to the plug-in through the links and independently via a Toby Cornish’s search, but I can’t seem to access the page. Do you know if I can access the plug-in through another means.

Once again, thank you.

Here I found a version from @Kota:

shall I upload compiled jar?

Hi all,

you can find many of these features in ops… see e.g. ops.*(), e.g. , haralick 2d/3d, zernike, hu-moments, first order statistics, tamura, object geometry 2d, 3d etc.



1 Like

thanks everyone. I will try out your suggestions

Hi @zimvet @dietzc ,

sorry to revive this old topic, but would like to do analysis as discussed here using ops and need help to get the code right :sweat_smile:

I hence wanted to ask if you could maybe post an example jython code using ops.haralick().entropy(net.imglib2.type.numeric.real.DoubleType out, net.imglib2.IterableInterval<T> in, int numGreyLevels, int distance, MatrixOrientation orientation)

on a 3D image. Please find two example images here, its one label image and an image to redirect the measurement to.
I could not find out what the parameters mean and how to set them up…
Thanks for your help!

For educational purposes, I post Groovy code instead of Jython (it should be straight-forward to translate :wink: , but I really recommend using Groovy over Jython for many reasons discussed elsewhere on this forum), and for simplicity, I used a 2D case here:

#@ Img input
#@ OpService ops

#@output horizontal
#@output vertical
#@output diagonal
#@output antidiagonal

import net.imagej.ops.image.cooccurrenceMatrix.MatrixOrientation2D

numGreyLevels = 4
distance = 4

horizontal ="haralick.entropy", input, numGreyLevels, distance, MatrixOrientation2D.HORIZONTAL).get()
vertical ="haralick.entropy", input, numGreyLevels, distance, MatrixOrientation2D.VERTICAL).get()
diagonal ="haralick.entropy", input, numGreyLevels, distance, MatrixOrientation2D.DIAGONAL).get()
antidiagonal ="haralick.entropy", input, numGreyLevels, distance, MatrixOrientation2D.ANTIDIAGONAL).get()

For the Boats sample image, I get the following result:

Name Value
1 horizontal 1.6813396646854826
2 vertical 1.6808005706487255
3 diagonal 1.7830193644669707
4 antidiagonal 1.7913779054776953

@imagejan thank you! so good! :slight_smile: