[Insight-users] Gatens Label Object Representation and Manipulation

Christian Werner christian.werner at rwth-aachen.de
Sat Feb 27 16:59:13 EST 2010


Hi!

Yes, USE_REVIEW is on I am sure about that since I already built some 
libraries. I am using Debian Lenny and gcc 4.4.3. But maybe it is only 
because I misunderstand something.

I see that I need label objects anyway, so it does not harm if I include 
them in my own code. But I was really confused about getting errors when 
just including a single header. Shouldn't this header take care of his 
own dependencies?

Anyway, these 3 lines are the very beginning of my labeling try and 
these already produce errors:

typedef itk::Image< unsigned char,  2 >   InputImageType;
...
56  typedef ShapeLabelObject<unsigned char, 2> LabelObjectType;
57  typedef LabelMap< LabelObjectType >        LabelMapType;
58  typedef itk::BinaryImageToLabelMapFilter<InputImageType, 
LabelMapType> ImageToLabelType;
59  //2)
60  ImageToLabelType::Pointer image2LabelMap = ImageToLabelType::New();

Compiler Errors:
/home/christian/programming/itk/labeling/testITK.cxx: In function ‘int 
main(int, char**)’:
/home/christian/programming/itk/labeling/testITK.cxx:56: error: expected 
initializer before ‘<’ token
/home/christian/programming/itk/labeling/testITK.cxx:57: error: expected 
initializer before ‘<’ token
/home/christian/programming/itk/labeling/testITK.cxx:58: error: 
‘LabelMapType’ was not declared in this scope
/home/christian/programming/itk/labeling/testITK.cxx:58: error: template 
argument 2 is invalid
/home/christian/programming/itk/labeling/testITK.cxx:58: error: invalid 
type in declaration before ‘;’ token
/home/christian/programming/itk/labeling/testITK.cxx:60: error: expected 
initializer before ‘image2LabelMap’

Maybe I don't get this labeling right... ?

This is what I include now:

#include "itkImageToImageFilter.h"
#include "itkShapeLabelObject.h"
#include "itkLabelMap.h"
#include "itkBinaryImageToLabelMapFilter.h"
#include "itkLabelMapToRGBImageFilter.h"



Bill Lorensen wrote:
> When you configured ITK did you build with USE_REVIEW ON?
>
> If so, what platform/compiler are you using?
>
> Bill
>
> On Sat, Feb 27, 2010 at 2:24 PM, Christian Werner
> <christian.werner at rwth-aachen.de> wrote:
>   
>> Hello!
>>
>> I am off to make some serious object labling and manipulation. Unfortunately
>> some very basic code does not compile:
>>
>> #include "itkBinaryImageToLabelMapFilter.h"
>> int main( int argc, char * argv[] )
>> {
>> }
>>
>> christian at trinity:~/programming/itk/labeling/bin$ make -j2
>> Scanning dependencies of target testITK
>> [100%] Building CXX object CMakeFiles/testITK.dir/testITK.o
>> In file included from
>> /home/christian/programming/itk/labeling/testITK.cxx:2:
>> /opt/InsightToolkit-3.16.0/Code/Review/itkBinaryImageToLabelMapFilter.h:54:
>> error: expected type-specifier before ‘LabelMap’
>> /opt/InsightToolkit-3.16.0/Code/Review/itkBinaryImageToLabelMapFilter.h:54:
>> error: expected ‘>’ before ‘LabelMap’
>> make[2]: *** [CMakeFiles/testITK.dir/testITK.o] Error 1
>> make[1]: *** [CMakeFiles/testITK.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> I can fix this, when I edit (and this already feels bad) the
>> itkBinaryImageToLabelMapFilter.h by adding
>>
>> #include "itkLabelMap.h"
>> #include "itkLabelObject.h"
>>
>> The above code compiles this way. However if I actually use some functions
>> out of the itkBinaryImageToLabelMapFilter.h I get errors over errors.
>>
>> My CMakeLists looks like this:
>>
>> cmake_minimum_required(VERSION 2.4)
>>
>> PROJECT(testITK)
>>
>> FIND_PACKAGE(ITK REQUIRED)
>> IF(ITK_FOUND)
>> INCLUDE(${ITK_USE_FILE})
>> ENDIF(ITK_FOUND)
>>
>> ADD_EXECUTABLE(testITK testITK.cxx)
>>
>> TARGET_LINK_LIBRARIES(testITK ITKCommon ITKIO ITKBasicFilters ITKStatistics)
>>
>>
>> General ITK programming works without trouble. I must be doing something
>> totally wrong, any suggestions?
>>
>>
>> Best regards,
>> Christian
>>
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>     



More information about the Insight-users mailing list