[Insight-users] Re: Problems with ImageToHistogramGenerator

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Fri Oct 20 05:50:41 EDT 2006


On Fri, 20 Oct 2006 11:40:44 +0200, Luca Binotto <binotto at lycos.de> wrote:

> Hello Gaetan,
> thanks for the replay !
> I don't understand what do you mean with "linking a program with  
> ITKStatistics",
> Can u give me an example ?

yes :-)
you should have something like:

   ADD_EXECUTABLE(main main.cxx)
   TARGET_LINK_LIBRARIES(main ITKCommon ITKStatistics)

in your CMakeLists.txt file, where "main" is the name of your executable

Gaetan


> Thanks again   Luca
>
> Hi,
>
> have you linked your program with ITKStatistics ?
>
> Regards,
>
> Gaetan
>
> On Thu, 19 Oct 2006 15:50:29 +0200, Luca Binotto <binotto at lycos.de>  
> wrote:
>
>> Hello there,
>>
>> I'm working on a 3D scalar dataset, I applied the gradient magnitude
>> and the laplacian filter to it, then I combined them in a
>> vector image by means of the itkCompose3DVectorImageFilter.
>> After that I gave its output to the itkImageToHistogramGenerator
>> but I got errors.Cannot understand what's going wrong.
>>
>> The read image is: (256x256x128)
>> typedef unsigned char   PixelType;
>>   const unsigned int   Dimension = 3;
>> typedef itk::Image<PixelType,Dimension>  ImageType;
>>
>>
>> typedef itk::Compose3DVectorImageFilter<ImageType >   
>> vectImageFilterType;
>>   vectImageFilterType::Pointer composer =  vectImageFilterType::New();
>>
>>    composer->SetInput1( reader->GetOutput() );
>>    composer->SetInput2( gradientMagnitude->GetOutput() );
>>    composer->SetInput3( laplacian->GetOutput() );
>>
>>  typedef  vectImageFilterType::OutputImageType  CompImageType;
>>
>>  typedef itk::Statistics::ImageToHistogramGenerator<   CompImageType >
>> HistogramGeneratorType;
>> HistogramGeneratorType::Pointer histogramGenerator =
>> HistogramGeneratorType::New();
>>
>>  typedef HistogramGeneratorType::SizeType   SizeType;
>>
>>    SizeType size;
>>
>>    size[0] = 255;
>>    size[1] = 255;
>>    size[2] = 255;
>>
>>    histogramGenerator->SetNumberOfBins( size );
>>
>>   histogramGenerator->SetInput( composer->GetOutput());
>>   histogramGenerator->SetMarginalScale( 10.0 );
>>   histogramGenerator->Compute();
>>
>> my compiler output:
>>
>> CMakeFiles/vtkitkOTF.dir/main.o: In function
>> `itk::ObjectFactory<itk::Statistics::DenseFrequencyContainer>::Create()':
>> main.cpp:(.text._ZN3itk13ObjectFactoryINS_10Statistics23DenseFrequencyContainerEE6CreateEv[itk::ObjectFactory<itk::Statistics::DenseFrequencyContainer>::Create()]+0x8):
>> undefined reference to `typeinfo for
>> itk::Statistics::DenseFrequencyContainer'
>> main.cpp:(.text._ZN3itk13ObjectFactoryINS_10Statistics23DenseFrequencyContainerEE6CreateEv[itk::ObjectFactory<itk::Statistics::DenseFrequencyContainer>::Create()]+0x55):
>> undefined reference to `typeinfo for
>> itk::Statistics::DenseFrequencyContainer'
>> CMakeFiles/vtkitkOTF.dir/main.o: In function
>> `itk::Statistics::Histogram<double, 3u,
>> itk::Statistics::DenseFrequencyContainer>::GetFrequency(unsigned long
>> const&) const':
>> main.cpp:(.text._ZNK3itk10Statistics9HistogramIdLj3ENS0_23DenseFrequencyContainerEE12GetFrequencyERKm[itk::Statistics::Histogram<double,
>> 3u, itk::Statistics::DenseFrequencyContainer>::GetFrequency(unsigned
>> long const&) const]+0x22): undefined reference to
>> `itk::Statistics::DenseFrequencyContainer::GetFrequency(unsigned long)
>> const'
>> CMakeFiles/vtkitkOTF.dir/main.o: In function
>> `itk::Statistics::DenseFrequencyContainer::New()':
>> main.cpp:(.text._ZN3itk10Statistics23DenseFrequencyContainer3NewEv[itk::Statistics::DenseFrequencyContainer::New()]+0x55):
>> undefined reference to
>> `itk::Statistics::DenseFrequencyContainer::DenseFrequencyContainer()'
>> CMakeFiles/vtkitkOTF.dir/main.o: In function
>> `itk::Statistics::Histogram<double, 3u,
>> itk::Statistics::DenseFrequencyContainer>::SetToZero()':
>> main.cpp:(.text._ZN3itk10Statistics9HistogramIdLj3ENS0_23DenseFrequencyContainerEE9SetToZeroEv[itk::Statistics::Histogram<double,
>> 3u, itk::Statistics::DenseFrequencyContainer>::SetToZero()]+0x18):
>> undefined reference to
>> `itk::Statistics::DenseFrequencyContainer::SetToZero()'
>> CMakeFiles/vtkitkOTF.dir/main.o: In function
>> `itk::Statistics::Histogram<double, 3u,
>> itk::Statistics::DenseFrequencyContainer>::Initialize(itk::Size<3u>
>> const&)':
>> main.cpp:(.text._ZN3itk10Statistics9HistogramIdLj3ENS0_23DenseFrequencyContainerEE10InitializeERKNS_4SizeILj3EEE[itk::Statistics::Histogram<double,
>> 3u, itk::Statistics::DenseFrequencyContainer>::Initialize(itk::Size<3u>
>> const&)]+0x238): undefined reference to
>> `itk::Statistics::DenseFrequencyContainer::Initialize(unsigned long)'
>> CMakeFiles/vtkitkOTF.dir/main.o: In function
>> `itk::Statistics::Histogram<double, 3u,
>> itk::Statistics::DenseFrequencyContainer>::IncreaseFrequency(unsigned
>> long const&, float)':
>> main.cpp:(.text._ZN3itk10Statistics9HistogramIdLj3ENS0_23DenseFrequencyContainerEE17IncreaseFrequencyERKmf[itk::Statistics::Histogram<double,
>> 3u,
>> itk::Statistics::DenseFrequencyContainer>::IncreaseFrequency(unsigned
>> long const&, float)]+0x2b): undefined reference to
>> `itk::Statistics::DenseFrequencyContainer::IncreaseFrequency(unsigned
>> long, float)'
>> collect2: ld returned 1 exit status
>> make[2]: *** [vtkitkOTF] Error 1
>> make[2]: Leaving directory `/home/luca/devel/vtkitkOTF'
>> make[1]: *** [CMakeFiles/vtkitkOTF.dir/all] Error 2
>> make[1]: Leaving directory `/home/luca/devel/vtkitkOTF'
>> make: *** [all] Error 2
>>
>> Someone can explain me the problem ?
>>
>> Thanks in advance, Luca
>>
>> Benachrichtigung bei E-Mail Empfang! -
>> http://mail.lycos.de/app/lycosinside/setupLI.exe
>
>
>



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list