[Insight-users] bug in itkOptGrayscaleMorphologicalClosingImageFilter.txx ?

Oleksandr Dzyubak adzyubak at gmail.com
Fri Sep 17 16:50:36 EDT 2010


Dear IT users,

I just tried to compile the example from ITK
itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx
and got a compilation error below.


**********
dzyubak at debian-alex: /BUILD$ make
[100%] Building CXX object 
CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx.o
In file included from 
/usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.txx:20,
from 
/usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:159,
from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Closing/2D/Src/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx:22:
/usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.h:56: 
error: redefinition of ‘class 
itk::GrayscaleMorphologicalClosingImageFilter<TInputImage, TOutputImage, 
TKernel>’
/usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:53: 
error: previous definition of ‘class 
itk::GrayscaleMorphologicalClosingImageFilter<TInputImage, TOutputImage, 
TKernel>’
In file included from 
/usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.h:155,
from 
/usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.txx:20,
from 
/usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:159,
from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Closing/2D/Src/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx:22:

.....
etc...
.....

/usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.txx:147: 
error: ‘void itk::GrayscaleMorphologicalClosingImageFilter<TInputImage, 
TOutputImage, TKernel>::PrintSelf(std::ostream&, itk::Indent) const’ 
previously declared here
make[2]: *** 
[CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx.o] 
Error 1
make[1]: *** 
[CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/all] 
Error 2
make: *** [all] Error 2
dzyubak at debian-alex: /BUILD$
*********

Is this a bug?

After digging the header and template files,
I found that all those errors could be fixed
by making corrections in the template file
"itkOptGrayscaleMorphologicalClosingImageFilter.txx" as below.

// #include "itkGrayscaleMorphologicalClosingImageFilter.h"
#include "itkOptGrayscaleMorphologicalClosingImageFilter.h"

As I can see, similar corrections should be done in the template
itkOptGrayscaleMorphologicalOpeningImageFilter.txx as well

// #include "itkGrayscaleMorphologicalOpeningImageFilter.h"
#include "itkOptGrayscaleMorphologicalOpeningImageFilter.h"

Regards,

Alex



More information about the Insight-users mailing list