[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> </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> </DIV>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"> <?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"> <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"> <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"> </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"> =20
</SPAN>typedef itk::RGBPixel<float><SPAN=20
style=3D"mso-spacerun: yes"> =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"> =20
</SPAN>typedef<SPAN=20
style=3D"mso-spacerun: =
yes"> &n=
bsp; =20
</SPAN>float<SPAN style=3D"mso-spacerun: yes"> =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"> <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"> =20
</SPAN>static ExternalType Get( const InternalType & 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"> =
</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"> </SPAN>return =
static_cast<ExternalType>( 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"> =
</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"> </SPAN></SPAN><SPAN lang=3DEN-GB =
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">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"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>if( argc < 2 =
)<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> =
</SPAN>{<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>std::cerr =
<<=20
"Requiere los siguientes argumentos en la linea de comandos:" <<=20
std::endl;<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN><SPAN =
lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">std::cerr << "Usage :<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>HaloNucleo<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>FicheroImagenEntrada " =
<<=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"> </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"> =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"> =20
</SPAN>typedef unsigned char<SPAN=20
style=3D"mso-spacerun: yes"> =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"> =20
</SPAN>const unsigned int<SPAN=20
style=3D"mso-spacerun: =
yes"> =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"> <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"> =20
</SPAN></SPAN>////////////<SPAN style=3D"mso-spacerun: yes"> =
</SPAN>LECTURA=20
DE LA IMAGEN<SPAN=20
style=3D"mso-tab-count: =
1"> =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"> =20
</SPAN>typedef RedChannelPixelAccessor::InternalType<SPAN=20
style=3D"mso-spacerun: yes"> =
</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"> </SPAN>typedef itk::Image< =
InputPixelType,=20
Dimension ><SPAN style=3D"mso-spacerun: yes"> =20
</SPAN>ImageType;</SPAN><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"> </SPAN>typedef =
itk::ImageAdaptor<<SPAN=20
style=3D"mso-spacerun: yes"> </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"> &n=
bsp; &nb=
sp; =20
</SPAN>RedChannelPixelAccessor > =
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"> </SPAN>ImageAdaptorType::Pointer =
adaptor =3D=20
ImageAdaptorType::New();</SPAN><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"> =20
</SPAN>typedef itk::ImageFileReader< ImageType ><SPAN=20
style=3D"mso-spacerun: yes"> =
</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"> =20
</SPAN>ReaderType::Pointer reader =3D ReaderType::New();<SPAN=20
style=3D"mso-spacerun: yes"> </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"> =20
</SPAN>reader->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"> =20
</SPAN>reader->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"> </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>adaptor->SetImage(=20
reader->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"> </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB"><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>typedef=20
itk::Statistics::ScalarImageToListAdaptor<<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"> &n=
bsp; &nb=
sp; =20
</SPAN></SPAN>ImageType ><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>TipoAdaptador;<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"><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>typedef itk::Image< unsigned char, Dimension ><SPAN=20
style=3D"mso-spacerun: yes"> =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"> =20
</SPAN>typedef itk::RescaleIntensityImageFilter< 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"> &n=
bsp; &nb=
sp; &nbs=
p; =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"> &n=
bsp; &nb=
sp;=20
</SPAN><SPAN=20
style=3D"mso-spacerun: =
yes"> &n=
bsp; </SPAN>&g=
t;<SPAN=20
style=3D"mso-spacerun: yes"> =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"> =20
</SPAN>RescalerType::Pointer rescaler =3D =
RescalerType::New();</SPAN><SPAN=20
lang=3DEN-GB 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"> =20
</SPAN>rescaler->SetOutputMinimum(<SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>0<SPAN style=3D"mso-spacerun: yes"> =
</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"> =20
</SPAN>rescaler->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"> =20
</SPAN>rescaler->SetInput( adaptor );<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">//////////<SPAN=20
style=3D"mso-tab-count: =
1"> =20
</SPAN>GENERACION DEL HISTOGRAMA<SPAN=20
style=3D"mso-tab-count: =
1"> =20
</SPAN>/////////////////// <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>typedef TipoPixel<SPAN=20
style=3D"mso-spacerun: yes"> =20
</SPAN>TipoMedidaHistograma;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">typedef=20
itk::Statistics::ListSampleToHistogramGenerator<<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"> &n=
bsp; &nb=
sp; &nbs=
p; =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"> &n=
bsp; =20
</SPAN><SPAN=20
style=3D"mso-spacerun: =
yes"> &n=
bsp; </SPAN>Ti=
poMedidaHistograma<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: =
yes"> &n=
bsp; &nb=
sp; &nbs=
p;  =
; =20
</SPAN>> TipoGenerador;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>TipoGenerador::Pointer =
generator =3D=20
TipoGenerador::New(); <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">typedef =
TipoGenerador::HistogramType<SPAN=20
style=3D"mso-spacerun: yes"> =
</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"> =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"> =20
</SPAN>size.Fill( 255 );</SPAN><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"> =20
</SPAN>generator->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"> =20
</SPAN>generator->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"> =20
</SPAN>generator->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"> =20
</SPAN>generator->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"> =20
</SPAN>Histograma::Pointer histogram =3D =
generator->GetOutput();</SPAN><SPAN=20
lang=3DEN-GB 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"> =20
</SPAN>const unsigned int histogramSize =3D=20
histogram->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"> =20
</SPAN></SPAN>std::cout << "Tamano del histograma" << =
histogramSize=20
<< std::endl; <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN><SPAN lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">for( unsigned int bin=3D0; bin <=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"> =20
</SPAN></SPAN>{<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>std::cout =
<<=20
"bin =3D " << bin << " frecuencia =3D ";<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN=20
style=3D"mso-spacerun: yes"> </SPAN><SPAN =
lang=3DEN-GB=20
style=3D"mso-ansi-language: EN-GB">std::cout << =
histogram->GetFrequency(=20
bin, 0 ) <<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"> =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"> =20
</SPAN>return 0;</SPAN><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">}</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm =
0pt">/////////////////////// END CODE=20
///////////////////////////////////////</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2></FONT> </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> </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<class itk::Image<class=20
itk::RGBPixel<float>,2>,class=20
RedChannelPixelAccessor>'<BR>  =
;=20
E:\C++\halonucleo.cxx(142) : see reference to class template =
instantiation=20
'itk::Statistics::ListSampleToHistogramGenerator<class=20
itk::ImageAdaptor<class itk::Image<class=20
itk::RGBPixel<float>,2>,class =
RedChannelPixelAccessor>,unsigned=20
char,c<BR>lass itk::Statistics::DenseFrequencyContainer<float> =
>' being=20
compiled</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><FONT face=3DArial=20
size=3D2> =20
=20
...</FONT> </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> </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> </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> </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> </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> </DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_001A_01C3BA8F.23ED26A0--