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.
To compute the matrix and features (they are both a characteristic of the entire region they are computed on), use the itk::RegionOfInterestImageFilter.
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:
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.
where only the ROI is quantized, thereby getting heterogeneity information WITHIN the ROI.
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.
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.