[Insight-users] Runtime error using ScalarImageToGreyLevelCooccurrenceMatrixGenerator

David Doria daviddoria at gmail.com
Thu Jun 28 13:58:20 EDT 2012


On Thu, Jun 28, 2012 at 1:32 PM, Hernan Ledesma <fledesma at inti.gob.ar> wrote:
> Hi,
> I have some trouble using the class
> itk::Statistics::ScalarImageToGreyLevelCooccurrenceMatrixGenerator<>
> I need to compute the GLCM of an RGB image for texture analysis
> I'm doing:
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
> typedef itk::Image<float,2> ScalarImageType;
> typedef itk::RGBToLuminanceImageFilter<ProcessingImageType,ScalarImageType>
> RGBToScalarFilterType;
> RGBToScalarFilterType::Pointer toScalarFilter=RGBToScalarFilterType::New();
> toScalarFilter->SetInput(filter->GetOutput());
> toScalarFilter->Update();
>
> typedef
> itk::Statistics::ScalarImageToGreyLevelCooccurrenceMatrixGenerator<ScalarImageType>
> CooccurrenceMatrixGeneratorType;
> CooccurrenceMatrixGeneratorType::Pointer
> generator=CooccurrenceMatrixGeneratorType::New();
> generator->SetInput(toScalarFilter->GetOutput());
> generator->SetNormalize(true);
> generator->Compute();
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> where ProcessingImageType is the type of a processed image:
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
> typedef itk::RGBPixel<float> ProcessingPixelType;
> typedef itk::Image<ProcessingPixelType,2> ProcessingImageType;
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> and filter->GetOutput() is the processing function (Gradient anisotropic
> diffusion filter).
> I receive a runtime error at the generator->Compute(). What I'm doing bad?
>
> Thanks.
>
> Hernán Ledesma.

That class seems to have been replaced by:

http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToCooccurrenceMatrixFilter.html
http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures

David


More information about the Insight-users mailing list