Texture for all objects with labeled images

I would like to compute texture statistics on a gray value image, but separately for image regions that are given in a separate label image. Basically the same as itk::LabelStatisticsImageFilter<RawImage, LabelImage> does, but for texture.

Does that exist? Or is there a typical workflow how to do that in ITK? I could not find a ready-made module that would take a LabelImage. The itk::Statistics::ScalarImageToTextureFeaturesFilter seems useful but takes only a mask, not a label image. Are there other ways to achieve that, without having to iterate over all the labels individually?

I highly doubt that. Iterating over labels sounds like your best bet.

Thanks @dzenanz for the quick response! Iā€™ll implement it with iteration over the objects then.

I guess its not too likely that someone would implement this with a single pass over the image? I understand that this comes with the problem that it may consume excessive memory for the many 2D histogramsā€¦

I think that texture computation is demanding, and doing labels in parallel would not bring much, if any, improvement.

Thanks again @dzenanz for the quick response!

My use case is that I have hundreds if not thousands of small segmented objects in an image. To create the textures I currently iterate the image thousands of times, every time creating a single texture. The simple iteration over the image adds up to a lot of runtime.

So I do not mean that ITK should create the texture measurements in parallel like in ā€œmulti-threaded parallelā€. I mean it would already help a lot if a single pass over the image would be sufficient, even if internally ITK processes object after object sequentially.

Would something like that be possible, for example by extracting a temporary internal representation of the object intensities for each object?

Does CoocurrenceTextureFeaturesImageFilter help you?

Could you compute the texture features for all of your object in one pass, then use LabelStatisticsImageFilter on that?

1 Like

I will take a look at that! Its quite cool, maybe this is what I need. Thanks!