[Insight-users] bug in itkOptGrayscaleMorphologicalClosingImageFilter.txx ?

Oleksandr Dzyubak adzyubak at gmail.com
Wed Sep 22 09:33:19 EDT 2010


Hi Luis,

After recompiling ITK-3.18 with
ITK_USE_CONSOLIDATED_MORPHOLOGY set to ON,
the example from ITK
itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx
works. Inspired by that, I downloaded a complete suit
"Consolidated Morphology" from Insight Journal

http://www.insight-journal.org/browse/publication/124

and tried to compile it.

Well, it gives me a whole basket of similar "redefinition" errors .

****************
dzyubak at debian-alex: /BUILD$ make
[  4%] Building CXX object CMakeFiles/blackTopHat2D.dir/blackTopHat2D.cxx.o
In file included from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkMovingHistogramImageFilter.h:24,
                 from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkMovingHistogramMorphologyImageFilter.h:20,
                 from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkMovingHistogramErodeImageFilter.h:20,
                 from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkGrayscaleMorphologicalClosingImageFilter.h:21,
                 from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkBlackTopHatImageFilter.txx:23,
                 from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkBlackTopHatImageFilter.h:132,
                 from 
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/blackTopHat2D.cxx:3:
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkOffsetLexicographicCompare.h:16: 
error: redefinition of ‘class 
itk::Functor::OffsetLexicographicCompare<VOffsetDimension>’
/usr/local/include/InsightToolkit/Common/itkOffset.h:221: error: 
previous definition of ‘class 
itk::Functor::OffsetLexicographicCompare<VOffsetDimension>’

........
.......
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkvHGWUtilities.txx:305: 
warning: comparison between signed and unsigned integer expressions
make[2]: *** [CMakeFiles/blackTopHat2D.dir/blackTopHat2D.cxx.o] Error 1
make[1]: *** [CMakeFiles/blackTopHat2D.dir/all] Error 2
make: *** [all] Error 2

************

What am I doing wrong?
Is there any specific detail/switch I must know about like
in case  of "with ITK_USE_CONSOLIDATED_MORPHOLOGY set to ON"?

Thanks for your help,

Alex


Luis Ibanez wrote:
> Hi Oleksander,
>
>
> 1) What ITK version are you using ?
>
> 2) Please note that you must configure ITK with
>     ITK_USE_CONSOLIDATED_MORPHOLOGY
>     set to ON, in order to use that class.
>
>
>     Regards,
>
>
>           Luis
>
>
> ----------------------------------------------------------------
> On Fri, Sep 17, 2010 at 4:50 PM, Oleksandr Dzyubak <adzyubak at gmail.com 
> <mailto:adzyubak at gmail.com>> wrote:
>
>
>     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
>
>     _____________________________________
>     Powered by www.kitware.com <http://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