Whole Image binning for GLCM

Hi,

I am trying to extract GLCM matrix from an image and mask using itk::Statistics::ScalarImageToCooccurrenceMatrixFilter. I wanted to verify how the quantization happens on the provided binning information:

  1. Only the region inside the mask is quantized
  2. The entire image is quantized

Regardless of which one is being done, how do I do the other?

Cheers,
Sarthak

Hi Sarthak,

To compute GLCM on local regions, use the ITKTextureFeatures module:

https://github.com/InsightSoftwareConsortium/ITKTextureFeatures

HTH,
Matt

Hey Matt,

Thanks, I am familiar with that filter but I need to extract the GLCM matrix.

Cheers,
Sarthak

To just inspect or verify the GLCM matrix content, use a debugger such as GDB or edit the source code to write out intermediate results. :open_book:

Hey Matt,

I need the option to combine the features in different ways, hence I need access to the GLCM matrix.

To do this, I am using itk::Statistics::ScalarImageToCooccurrenceMatrixFilter to get the matrix and then using itk::Statistics::HistogramToTextureFeaturesFilter to extract features.

However, I am unsure if there is a way I can do the quantization of the input image for the entire image but do the feature calculations only on the specified region of interest.

Cheers,
Sarthak

Hi Sarthak,

To compute the matrix and features (they are both a characteristic of the entire region they are computed on), use the itk::RegionOfInterestImageFilter.

HTH,
Matt

Hey Matt,

I think I may not have conveyed the question correctly. The (annotated) region of interest (ROI) is defined in the mask. I want to extract features only from this region, but I want to quantization/binning to happen to either the entire image or just that region. Basically, get 2 sets of features:

  1. where the entire image is quantized and I obtain features from the ROI which are scaled in relation to whole image, thereby capturing the heterogeneity information in the ROI related to the entire image.
  2. where only the ROI is quantized, thereby getting heterogeneity information WITHIN the ROI.

My question is, what of the above 2 does the current implementation of itk::Statistics::ScalarImageToCooccurrenceMatrixFilter do and how can I do the other?

Cheers,
Sarthak

The filter can do either, depending if the Mask input is set.

You will simply need to create two instances of it and run it twice.

1 Like

Hey Brad,

I understand that the filter can do the computation based on the provided mask, which actually takes care of point 2 in my previous comment, as (from what I have understood from the documentation and running the filter) the quantization seems to happen only on the provided ROI.

But, for 1, I want to calculate the features only INSIDE THE ROI but with the entire image getting quantized.

Cheers,
Sarthak

Please describe what you mean by “quantizing an image” here?

When I say “quantizing the whole image”, I mean that the histogram is calculated for the entire image and not just for the part defined in the mask.