<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi David,<br>
<br>
How can I visualize the results?<br>
I don't have access to T64.mha, I use
GeodesicActiveContourShapePriorImageFilterOutput4.mha. The slices that
output the extract filter (png files) are "blacks". See the following
code snippets<br>
<br>
//para mostrar un slice<br>
typedef unsigned char OutputPixelType;<br>
typedef itk::Image<OutputPixelType,2> OutputImageType;<br>
<br>
typedef unsigned char InputPixelType;<br>
typedef itk::Image<InputPixelType,3> InputImageType;<br>
<br>
typedef itk::ImageFileReader<InputImageType> ReaderMHAType;<br>
typedef itk::ImageFileWriter<OutputImageType> WriterPNGType;<br>
<br>
ReaderMHAType::Pointer readerMHA=ReaderMHAType::New();<br>
WriterPNGType::Pointer writerPNG=WriterPNGType::New();<br>
<br>
readerMHA->SetFileName("Energy0.mha");<br>
writerPNG->SetFileName("slice.png");<br>
<br>
typedef
itk::ExtractImageFilter<InputImageType,OutputImageType>
FilterType;<br>
FilterType::Pointer extractfilter=FilterType::New();<br>
extractfilter->InPlaceOn();<br>
extractfilter->SetDirectionCollapseToSubmatrix();<br>
.....<br>
.....<br>
<br>
I think that the problem is here. What am I doing wrong?<br>
<br>
Thank you David.<br>
<em></em><br>
<br>
El 28/06/12 14:58, David Doria escribió:
<blockquote
cite="mid:CABDpjTkYbs_8R=vCowNBHg=tRTKKiG7au7Ny632BFWF9CTAGOg@mail.gmail.com"
type="cite">
<pre wrap="">On Thu, Jun 28, 2012 at 1:32 PM, Hernan Ledesma <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:fledesma@inti.gob.ar"><fledesma@inti.gob.ar></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap="">That class seems to have been replaced by:
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToCooccurrenceMatrixFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToCooccurrenceMatrixFilter.html</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures">http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures</a>
David
</pre>
</blockquote>
<br>
</body>
</html>