[Insight-users] Runtime error using ScalarImageToGreyLevelCooccurrenceMatrixGenerator

Hernan Ledesma fledesma at inti.gob.ar
Thu Jun 28 13:32:47 EDT 2012


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120628/043db0c8/attachment.htm>


More information about the Insight-users mailing list