[Insight-users] histogram

David Llanos gva02 at elai . upm . es
Thu, 4 Dec 2003 17:50:44 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_001A_01C3BA8F.23ED26A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi all,

I have errors that I don't understand in the following algorithm that =
tries to make the histogram of the red channel of a RGB image:

=20

///////////////////////////////////////////BEGIN =
CODE///////////////////////////////////////////////////////

=20

#include "itkScalarImageToListAdaptor.h"

#include "itkImage.h"

#include "itkImageFileReader.h"

#include "itkListSampleToHistogramGenerator.h"

#include "itkImageAdaptor.h"

#include "itkImageRegionIteratorWithIndex.h"

#include "itkRescaleIntensityImageFilter.h"

=20

class RedChannelPixelAccessor =20

{

public:

  typedef itk::RGBPixel<float>   InternalType;

  typedef               float    ExternalType;

=20

  static ExternalType Get( const InternalType & input )=20

    {

      return static_cast<ExternalType>( input.GetRed() );

    }

};

  =20

int main( int argc, char * argv [] )

{

=20

   if( argc < 2 )

     {

     std::cerr << "Requiere los siguientes argumentos en la linea de =
comandos:" << std::endl;

     std::cerr << "Usage :  HaloNucleo  FicheroImagenEntrada " <<=20

std::endl;

     return -1;

     }

=20

   typedef unsigned char       TipoPixel;

   const unsigned int          Dimension =3D 2;

=20

=20

   ////////////  LECTURA DE LA IMAGEN            ///////////////////////


  typedef RedChannelPixelAccessor::InternalType  InputPixelType;


 typedef itk::Image< InputPixelType, Dimension >   ImageType;=20

 typedef itk::ImageAdaptor<  ImageType,=20

                             RedChannelPixelAccessor > ImageAdaptorType;


 ImageAdaptorType::Pointer adaptor =3D ImageAdaptorType::New();=20

  typedef itk::ImageFileReader< ImageType >   ReaderType;

  ReaderType::Pointer reader =3D ReaderType::New(); =20


  reader->SetFileName( argv[1] );

  reader->Update();

  adaptor->SetImage( reader->GetOutput() );

   typedef itk::Statistics::ScalarImageToListAdaptor<

                                    ImageType >   TipoAdaptador;

   typedef itk::Image< unsigned char, Dimension >   OutputImageType;

  typedef itk::RescaleIntensityImageFilter< ImageAdaptorType,=20

                                            OutputImageType=20

                                               >   RescalerType;


  RescalerType::Pointer rescaler =3D RescalerType::New();=20

  rescaler->SetOutputMinimum(  0  );

  rescaler->SetOutputMaximum( 255 );


  rescaler->SetInput( adaptor );

=20

//////////            GENERACION DEL HISTOGRAMA            =
///////////////////=20

   typedef TipoPixel        TipoMedidaHistograma;

   typedef itk::Statistics::ListSampleToHistogramGenerator<

                                             ImageAdaptorType,

                                             TipoMedidaHistograma

                                                  > TipoGenerador;

   TipoGenerador::Pointer generator =3D TipoGenerador::New();=20

   typedef TipoGenerador::HistogramType  Histograma;


   Histograma::SizeType size;

   size.Fill( 255 );=20

   generator->SetListSample( rescaler );

   generator->SetNumberOfBins( size );

   generator->SetMarginalScale( 10.0 );

   generator->Update();


   Histograma::Pointer histogram =3D generator->GetOutput();=20

   const unsigned int histogramSize =3D histogram->Size();


   std::cout << "Tamano del histograma" << histogramSize << std::endl;=20

   for( unsigned int bin=3D0; bin < histogramSize; bin++ )

     {

     std::cout << "bin =3D " << bin << " frecuencia =3D ";

     std::cout << histogram->GetFrequency( bin, 0 ) <<std::endl;

     }


   return 0;=20

}

/////////////////////// END CODE ///////////////////////////////////////





some errors are the following ones:



Compiling...
halonucleo.cxx
E:\Insight\Code\Numerics\Statistics\itkListSampleToHistogramGenerator.h(8=
0) : error C2039: 'MeasurementVectorSize' : is not a member of =
'ImageAdaptor<class itk::Image<class itk::RGBPixel<float>,2>,class =
RedChannelPixelAccessor>'
        E:\C++\halonucleo.cxx(142) : see reference to class template =
instantiation 'itk::Statistics::ListSampleToHistogramGenerator<class =
itk::ImageAdaptor<class itk::Image<class itk::RGBPixel<float>,2>,class =
RedChannelPixelAccessor>,unsigned char,c
lass itk::Statistics::DenseFrequencyContainer<float> >' being compiled

                ...         =20

halonucleo.obj - 7 error(s), 4 warning(s)
-------------------------------------------------------------------------=
-------------------------------------------------------------------------=
---------------------------------

=20
Would somebody know how to say I do to solve them?
=20
Thanks in advange and regards,
=20
David
=20
 
------=_NextPart_000_001A_01C3BA8F.23ED26A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have errors that I don't understand =
in the=20
following algorithm that tries to make the histogram of the red channel =
of a RGB=20
image:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">&nbsp;<?xml:namespace =
prefix =3D o=20
ns =3D "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm =
0pt">///////////////////////////////////////////BEGIN=20
CODE///////////////////////////////////////////////////////</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">&nbsp;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">#include=20
"itkScalarImageToListAdaptor.h"<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">#include =
"itkImage.h"<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">#include=20
"itkImageFileReader.h"<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">#include=20
"itkListSampleToHistogramGenerator.h"<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">#include=20
"itkImageAdaptor.h"<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">#include=20
"itkImageRegionIteratorWithIndex.h"<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">#include=20
"itkRescaleIntensityImageFilter.h"<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">class RedChannelPixelAccessor<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">{<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">public:<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef itk::RGBPixel&lt;float&gt;<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;=20
</SPAN>InternalType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef<SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
</SPAN>float<SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;=20
</SPAN>ExternalType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>static ExternalType Get( const InternalType &amp; input )=20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>{<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return =

static_cast&lt;ExternalType&gt;( input.GetRed() );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp; =
</SPAN>}<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">};<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;</SPAN></SPAN><SPAN lang=3DEN-GB =

style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">int main( int argc, char * argv []=20
)<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">{<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">&nbsp;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; </SPAN>if( argc &lt; 2 =
)<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; =
</SPAN>{<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>std::cerr =
&lt;&lt;=20
"Requiere los siguientes argumentos en la linea de comandos:" &lt;&lt;=20
std::endl;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN =
lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">std::cerr &lt;&lt; "Usage :<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; </SPAN>HaloNucleo<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; </SPAN>FicheroImagenEntrada " =
&lt;&lt;=20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">std::endl;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return=20
-1;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>}<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>typedef unsigned char<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>TipoPixel;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>const unsigned int<SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>Dimension =3D 2;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN></SPAN>////////////<SPAN style=3D"mso-spacerun: yes">&nbsp; =
</SPAN>LECTURA=20
DE LA IMAGEN<SPAN=20
style=3D"mso-tab-count: =
1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>///////////////////////<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef RedChannelPixelAccessor::InternalType<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; =
</SPAN>InputPixelType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;</SPAN>typedef itk::Image&lt; =
InputPixelType,=20
Dimension &gt;<SPAN style=3D"mso-spacerun: yes">&nbsp;&nbsp;=20
</SPAN>ImageType;</SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;</SPAN>typedef =
itk::ImageAdaptor&lt;<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; </SPAN>ImageType, =
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>RedChannelPixelAccessor &gt; =
ImageAdaptorType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;</SPAN>ImageAdaptorType::Pointer =
adaptor =3D=20
ImageAdaptorType::New();</SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef itk::ImageFileReader&lt; ImageType &gt;<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; =
</SPAN>ReaderType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>ReaderType::Pointer reader =3D ReaderType::New();<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>reader-&gt;SetFileName( argv[1] );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>reader-&gt;Update();<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;</SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;</SPAN>adaptor-&gt;SetImage(=20
reader-&gt;GetOutput() );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;</SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef=20
itk::Statistics::ScalarImageToListAdaptor&lt;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN></SPAN>ImageType &gt;<SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>TipoAdaptador;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">&nbsp;<SPAN =
lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef itk::Image&lt; unsigned char, Dimension &gt;<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;=20
</SPAN>OutputImageType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>typedef itk::RescaleIntensityImageFilter&lt; ImageAdaptorType,=20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>OutputImageType <o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;=20
</SPAN><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>&g=
t;<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;=20
</SPAN>RescalerType;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>RescalerType::Pointer rescaler =3D =
RescalerType::New();</SPAN><SPAN=20
lang=3DEN-GB style=3D"mso-ansi-language: =
EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>rescaler-&gt;SetOutputMinimum(<SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>0<SPAN style=3D"mso-spacerun: yes">&nbsp; =
</SPAN>);<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>rescaler-&gt;SetOutputMaximum( 255 );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;=20
</SPAN>rescaler-&gt;SetInput( adaptor );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">&nbsp;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">//////////<SPAN=20
style=3D"mso-tab-count: =
1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>GENERACION DEL HISTOGRAMA<SPAN=20
style=3D"mso-tab-count: =
1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>///////////////////&nbsp;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; </SPAN>typedef TipoPixel<SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>TipoMedidaHistograma;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">typedef=20
itk::Statistics::ListSampleToHistogramGenerator&lt;<o:p></o:p></SPAN></P>=

<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN></SPAN>ImageAdaptorType,<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>Ti=
poMedidaHistograma<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
</SPAN>&gt; TipoGenerador;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; </SPAN>TipoGenerador::Pointer =
generator =3D=20
TipoGenerador::New();&nbsp;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">typedef =
TipoGenerador::HistogramType<SPAN=20
style=3D"mso-spacerun: yes">&nbsp; =
</SPAN>Histograma;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>Histograma::SizeType size;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>size.Fill( 255 );</SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>generator-&gt;SetListSample( rescaler );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>generator-&gt;SetNumberOfBins( size );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>generator-&gt;SetMarginalScale( 10.0 );<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>generator-&gt;Update();<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>Histograma::Pointer histogram =3D =
generator-&gt;GetOutput();</SPAN><SPAN=20
lang=3DEN-GB style=3D"mso-ansi-language: =
EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>const unsigned int histogramSize =3D=20
histogram-&gt;Size();<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN></SPAN>std::cout &lt;&lt; "Tamano del histograma" &lt;&lt; =
histogramSize=20
&lt;&lt; std::endl;&nbsp;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">for( unsigned int bin=3D0; bin &lt;=20
histogramSize; bin++ )<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN></SPAN>{<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>std::cout =
&lt;&lt;=20
"bin =3D " &lt;&lt; bin &lt;&lt; " frecuencia =3D ";<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN =
lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">std::cout &lt;&lt; =
histogram-&gt;GetFrequency(=20
bin, 0 ) &lt;&lt;std::endl;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;=20
</SPAN>}<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes">&nbsp;&nbsp;=20
</SPAN>return 0;</SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">&nbsp;<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">}</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm =
0pt">/////////////////////// END CODE=20
///////////////////////////////////////</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt">&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial =
size=3D2>some=20
errors are the following ones:</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2></FONT>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2>Compiling...<BR>halonucleo.cxx<BR>E:\Insight\Code\Numerics\Stati=
stics\itkListSampleToHistogramGenerator.h(80)=20
: error C2039: 'MeasurementVectorSize' : is not a member of=20
'ImageAdaptor&lt;class itk::Image&lt;class=20
itk::RGBPixel&lt;float&gt;,2&gt;,class=20
RedChannelPixelAccessor&gt;'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
E:\C++\halonucleo.cxx(142) : see reference to class template =
instantiation=20
'itk::Statistics::ListSampleToHistogramGenerator&lt;class=20
itk::ImageAdaptor&lt;class itk::Image&lt;class=20
itk::RGBPixel&lt;float&gt;,2&gt;,class =
RedChannelPixelAccessor&gt;,unsigned=20
char,c<BR>lass itk::Statistics::DenseFrequencyContainer&lt;float&gt; =
&gt;' being=20
compiled</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
...</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2>halonucleo.obj - 7 error(s), 4 warning(s)<BR></FONT><SPAN =
lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p><FONT face=3DArial=20
size=3D2>----------------------------------------------------------------=
-------------------------------------------------------------------------=
------------------------------------------</FONT></o:p></SPAN></P>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p></SPAN>&nbsp;</DIV>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2>Would somebody know how to say I do to solve=20
them?</FONT></o:p></SPAN></DIV>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p></SPAN>&nbsp;</DIV>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2>Thanks in advange and regards,</FONT></o:p></SPAN></DIV>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p></SPAN>&nbsp;</DIV>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2>David</FONT></o:p></SPAN></DIV>
<DIV><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><o:p></o:p></SPAN>&nbsp;</DIV>
<DIV><SPAN lang=3DEN-GB style=3D"mso-ansi-language: EN-GB"><o:p><FONT =
face=3DArial=20
size=3D2></FONT></o:p></SPAN>&nbsp;</DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_001A_01C3BA8F.23ED26A0--