[Insight-users] Re: make problem

Luis Ibanez luis.ibanez at kitware.com
Wed Oct 10 09:43:01 EDT 2007


Hi Burak,

Thanks for the update.

Could you please resend your code using a packaging
method other than RAR ?

RAR is not an open standard:

    http://en.wikipedia.org/wiki/RAR_(file_format)

and there are no free tools for it on Debian linux.

Please use zip or tar.gz.


   Thanks


      Luis


------------------------
Burak Özkalaycı wrote:
> In fact there was no myLevelSetFunction header file since I just
> create a subclass derived from the SegmentationLevelSetFunction to
> implement the CalculateSpeedImage. But now I wrote it by copying from
> itkShapeDetectionLevelSetFunction.h.
> 
> Now it compiles but can not link the obj files. The make error log is now :
> 
> ============================================================
> make
> Scanning dependencies of target myMain
> [100%] Building CXX object CMakeFiles/myMain.dir/myMain.o
> Linking CXX executable myMain
> CMakeFiles/myMain.dir/myMain.o:(.rodata._ZTVN3itk18myLevelSetFunctionINS_5ImageIfLj3EEES2_EE[vtable
> for itk::myLevelSetFunction<itk::Image<float, 3u>, itk::Image<float,
> 3u> >]+0x118): undefined reference to
> `itk::myLevelSetFunction<itk::Image<float, 3u>, itk::Image<float, 3u>
> 
>>::CalculateSpeedImage()'
> 
> collect2: ld returned 1 exit status
> make[2]: *** [myMain] Error 1
> make[1]: *** [CMakeFiles/myMain.dir/all] Error 2
> make: *** [all] Error 2
> ============================================================
> 
> I attach the all files you need to compile this code. Thanks a lot for
> your concern.
> 
> Burak
> 
> On 10/10/07, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
>>Hi Burak,
>>
>>It seems that you forgot to put typedefs for "Pointer"
>>in the definition of the class: myLevelSetFunction"
>>
>>We will need the source code of "myLevelSetFunction.h"
>>to verify this.
>>
>>Please post that header file to the mailing list if you
>>are still interested in further advice.
>>
>>Otherwise, please look at files such as
>>
>>     itkShapeDetectionLevelSetFunction.h
>>     itkGeodesicActiveContoursLevelSetFunction.h
>>
>>for examples on the basic typedefs that you should
>>have in a class that is managed by SmartPointers.
>>
>>
>>    Thanks
>>
>>
>>       Luis
>>
>>
>>----------------------
>>Burak Özkalaycı wrote:
>>
>>>I figured out that to have a working segmentationLevelSetFunction I
>>>have to implement the CalculateSpeedImage in a subclass. That's why I
>>>changed my code a little bit and I attach it with the make error log.
>>>Thanks again
>>>
>>>Burak
>>>
>>>Revised code
>>>===============================
>>>// file name : tpls_main.cpp
>>>
>>>#if defined(_MSC_VER)
>>>#pragma warning ( disable : 4786 )
>>>#endif
>>>
>>>#ifdef __BORLANDC__
>>>#define ITK_LEAN_AND_MEAN
>>>#endif
>>>
>>>#include "itkImage.h"
>>>#include "itkImageFileReader.h"
>>>#include "itkImageFileWriter.h"
>>>
>>>#include "itkSegmentationLevelSetFunction.h"
>>>
>>>template <class TImageType, class TFeatureImageType>
>>>class myLevelSetFunction:itk::SegmentationLevelSetFunction<TImageType,
>>>TFeatureImageType>
>>>{
>>>  void CalculateSpeedImage()
>>>  {
>>>    this->SetSpeedImage(this->GetFeatureImage);
>>>  }
>>>};
>>>
>>>int main( int argc, char *argv[] )
>>>{
>>>  // Input Image
>>>  typedef   float           InputPixelType;
>>>  const     unsigned int    Dimension = 3;
>>>  typedef itk::Image< InputPixelType, Dimension >  InputImageType;
>>>
>>>  // Internal Image
>>>  typedef   float           InternalPixelType;
>>>  typedef itk::Image< InternalPixelType, Dimension >  InternalImageType;
>>>
>>>  // Output Image
>>>  typedef float OutputPixelType;
>>>  typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
>>>
>>>  typedef  itk::ImageFileReader< InternalImageType > ReaderType;
>>>  typedef  itk::ImageFileWriter<  OutputImageType  > WriterType;
>>>
>>>  // Read write initialization
>>>  ReaderType::Pointer reader1 = ReaderType::New();
>>>  ReaderType::Pointer reader2 = ReaderType::New();
>>>  WriterType::Pointer writer = WriterType::New();
>>>
>>>  reader1->SetFileName( argv[1] );
>>>  reader2->SetFileName( argv[2] );
>>>  writer->SetFileName(  argv[3] );
>>>
>>>  // MAIN ALGORITHM CAN START HERE !!
>>>
>>>  typedef myLevelSetFunction<InternalImageType, InternalImageType>
>>>LSFunctionType;
>>>  LSFunctionType::Pointer LS_function = LSFunctionType::New();
>>>
>>>  return 0;
>>>}
>>>===============================
>>>
>>>the make error log:
>>>===============================
>>>make
>>>Scanning dependencies of target tpls_main
>>>[100%] Building CXX object CMakeFiles/tpls_main.dir/tpls_main.o
>>>/home/xonobo/itk/InsightToolkit-3.2.0/Code/Common/itkSegmentationLevelSetFunction.h:
>>>In function 'int main(int, char**)':
>>>/home/xonobo/itk/InsightToolkit-3.2.0/Code/Common/itkSegmentationLevelSetFunction.h:52:
>>>error: 'typedef class
>>>itk::SmartPointer<itk::SegmentationLevelSetFunction<itk::Image<float,
>>>3u>, itk::Image<float, 3u> > >
>>>itk::SegmentationLevelSetFunction<itk::Image<float, 3u>,
>>>itk::Image<float, 3u> >::Pointer' is inaccessible
>>>/home/xonobo/CPP/itk_based/itkTPLS/tpls_main.cpp:80: error: within this context
>>>/home/xonobo/itk/InsightToolkit-3.2.0/Code/Common/itkLevelSetFunction.h:75:
>>>error: 'static itk::SmartPointer<itk::LevelSetFunction<TImageType> >
>>>itk::LevelSetFunction<TImageType>::New() [with TImageType =
>>>itk::Image<float, 3u>]' is inaccessible
>>>/home/xonobo/CPP/itk_based/itkTPLS/tpls_main.cpp:80: error: within this context
>>>/home/xonobo/CPP/itk_based/itkTPLS/tpls_main.cpp:80: error: conversion
>>>from 'itk::SmartPointer<itk::LevelSetFunction<itk::Image<float, 3u> >
>>>
>>>>' to non-scalar type
>>>
>>>'itk::SmartPointer<itk::SegmentationLevelSetFunction<itk::Image<float,
>>>3u>, itk::Image<float, 3u> > >' requested
>>>make[2]: *** [CMakeFiles/tpls_main.dir/tpls_main.o] Error 1
>>>make[1]: *** [CMakeFiles/tpls_main.dir/all] Error 2
>>>make: *** [all] Error 2
>>>===============================
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>


More information about the Insight-users mailing list