<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi,<br>
I have some trouble using the class
itk::Statistics::ScalarImageToGreyLevelCooccurrenceMatrixGenerator&lt;&gt;<br>
I need to compute the GLCM of an RGB image for texture analysis<br>
I<span class="st">'m doing:<br>
------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
typedef itk::Image&lt;float,2&gt; ScalarImageType;<br>
typedef
itk::RGBToLuminanceImageFilter&lt;ProcessingImageType,ScalarImageType&gt;
RGBToScalarFilterType;<br>
RGBToScalarFilterType::Pointer
toScalarFilter=RGBToScalarFilterType::New();<br>
toScalarFilter-&gt;SetInput(filter-&gt;GetOutput());<br>
toScalarFilter-&gt;Update();<br>
<br>
typedef
itk::Statistics::ScalarImageToGreyLevelCooccurrenceMatrixGenerator&lt;ScalarImageType&gt;
CooccurrenceMatrixGeneratorType;<br>
CooccurrenceMatrixGeneratorType::Pointer
generator=CooccurrenceMatrixGeneratorType::New();<br>
generator-&gt;SetInput(toScalarFilter-&gt;GetOutput());<br>
generator-&gt;SetNormalize(true);<br>
generator-&gt;Compute();<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
where </span><span class="st">ProcessingImageType is the type of a
processed image:<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------<br>
typedef itk::RGBPixel&lt;float&gt; ProcessingPixelType;<br>
typedef itk::Image&lt;ProcessingPixelType,2&gt; ProcessingImageType;<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
and </span><span class="st">filter-&gt;GetOutput() is the processing
function (</span><span class="st">Gradient <em>anisotropic diffusion</em></span><span
 class="st"> filter).<br>
</span><span class="st"> I receive a <em>runtime error</em> at the</span>
<span class="st">generator-&gt;Compute(). What I</span><span class="st">'</span><span
 class="st">m doing bad?</span><br>
<br>
Thanks.<br>
<br>
Hern&aacute;n Ledesma.<br>
<span class="st"><br>
</span>
</body>
</html>