Haralick -> Feature Calculator (BETA) vs. Image Features

Hi all,
I am calculating the Haralick features from several .tif-files using

a) Feature Calculator (BETA) Node
b) Image Features Node

The images are the same. Also node configuration is the same (number grey levels=32, distance =1, horizontal).
I expected identical results as the GLCM should be the same as well, but the feature values from the Feature Calculator (BETA) Node differ from the feature values from the Image Features Node.

Some values differ just slighly like Contrast (eg. 0.686 vs 0.663)
Some values differ enormous like Sum Variance (eg. 1053.51 vs. 607.09)
Some values are identical like Correlation (eg. 0.998 vs 0.998)

it doesn’t matter wich node configurations is set (number grey levels, distance, direction)…I can’t get the nodes calculating the same values for every feature.

Because I can’t imagine a mistake in the node internals maybe someone can give me a hint how to configure the nodes to get the same (correct) results.

regards

Hi @GMH_SuI,

Any chance that you could provide a workflow and one or two images (separately, if possible to compare the results with different implementations) that shows the differences? This would make investigating the issue a lot easier on our end. Thanks!

Best,
Stefan

Hi Stefan,
atteched you can find a simple workflow calculating haralick features on two randomly created images by image generator node and the images separately. Hope it helps to investigate the issue.
regards!
Kai

haralick_features_test.knwf (26.2 KB)
image0.tif (10.9 KB)
image1.tif (10.9 KB)

Hi Kai,

It did, thank you! I have to quote you on a sentence of your original post:

Because I can’t imagine a mistake in the node internals maybe someone can give me a hint how to configure the nodes to get the same (correct) results.

Well, the implementation of features are indeed slightly different between the two nodes. Feature Calculator (BETA) uses implementations from imagej-ops, so that results are consistent with ImageJ(2). Image Features, however, uses a slightly different implementation of computing the cooccurrence matrix, resulting in slightly different results.

Does that make sense, @GMH_SuI?

Best,
Stefan

2 Likes