[Insight-users] Texture analysis of regions

Hernan Ledesma fledesma at inti.gob.ar
Wed Oct 17 12:36:19 EDT 2012


Hello,

I need to apply ScalarImageToCooccurrenceMatrixFilter for texture 
analysis of image regions. I use that filter and works fine, but now I 
want to use maks. Extracting en each cicle the blobs corresponding to 
regions I generate the masks; but something is wrong because the results 
of energy, correlatin and inertia are the same for all regions.

Please see the folowing code snippet

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    typedef itk::Image<InputPixelType,2> GLCMImageType;
    typedef 
itk::Statistics::ScalarImageToCooccurrenceMatrixFilter<GLCMImageType> 
GLCMType;
    typedef GLCMType::HistogramType HistogramType;
    typedef 
itk::Statistics::HistogramToTextureFeaturesFilter<HistogramType> 
GLCMFeaturesType;

    GLCMType::Pointer glcmGenerator=GLCMType::New();
    typedef GLCMType::OffsetType OffsetType;
    OffsetType offset={{1,0}};
    glcmGenerator->SetOffset(offset);
    
importFilter2->SetImportPointer((InputPixelType*)s_plane->imageData,numberOfPixels,importImageFilterWillOwnTheBuffer);
    glcmGenerator->SetInput(importFilter2->GetOutput());
    glcmGenerator->SetInsidePixelValue(255);

    GLCMFeaturesType::Pointer glcmCalculator=GLCMFeaturesType::New();

    for (int i=0; i<blobs.GetNumBlobs(); i++)
    {
       currentBlob=blobs.GetBlob(i);
       currentBlob.FillBlob(mask_image,CV_RGB(255,255,255));

       
importFilter1->SetImportPointer((InputPixelType*)mask_image->imageData,numberOfPixels,importImageFilterWillOwnTheBuffer);

       glcmGenerator->SetMaskImage(importFilter1->GetOutput());
       glcmCalculator->SetInput(glcmGenerator->GetOutput());
       glcmCalculator->Update();

       // Features
       double energy=glcmCalculator->GetFeature(GLCMFeaturesType::Energy);
        .
        .
        .
     }
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Has anyone got any idea on texture analysis using mask?

Thanks in advance.

F. Hernán Ledesma.


More information about the Insight-users mailing list