Hi Alex,<br><br>I think that the problem is that we already<br>moved into ITK many of the classes from<br>this Insight Journal paper, and therefore<br>when you put those header again, they<br>conflict with each other.<br><br>
Please look for the classes that you want<br>to try, in the Insight/Code/Review directory.<br><br>You may not need to download them from<br>the Insight Journal.<br><br><br>    Regards,<br><br><br>          Luis<br><br><br>
---------------------------------------<br><div class="gmail_quote">On Wed, Sep 22, 2010 at 9:33 AM, Oleksandr Dzyubak <span dir="ltr">&lt;<a href="mailto:adzyubak@gmail.com">adzyubak@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Hi Luis,<br>
<br>
After recompiling ITK-3.18 with<div class="im"><br>
ITK_USE_CONSOLIDATED_MORPHOLOGY set to ON,<br></div><div class="im">
the example from ITK<br>
itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx<br></div>
works. Inspired by that, I downloaded a complete suit<br>
&quot;Consolidated Morphology&quot; from Insight Journal<br>
<br>
<a href="http://www.insight-journal.org/browse/publication/124" target="_blank">http://www.insight-journal.org/browse/publication/124</a><br>
<br>
and tried to compile it.<br>
<br>
Well, it gives me a whole basket of similar &quot;redefinition&quot; errors .<br>
<br>
****************<div class="im"><br>
dzyubak@debian-alex: /BUILD$ make<br></div>
[  4%] Building CXX object CMakeFiles/blackTopHat2D.dir/blackTopHat2D.cxx.o<br>
In file included from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkMovingHistogramImageFilter.h:24,<br>
                from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkMovingHistogramMorphologyImageFilter.h:20,<br>
                from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkMovingHistogramErodeImageFilter.h:20,<br>
                from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkGrayscaleMorphologicalClosingImageFilter.h:21,<br>
                from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkBlackTopHatImageFilter.txx:23,<br>
                from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkBlackTopHatImageFilter.h:132,<br>
                from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/blackTopHat2D.cxx:3:<br>
/mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Submission/MIDAS_Journal_124_1/consolidatedMorphology/itkOffsetLexicographicCompare.h:16: error: redefinition of ‘class itk::Functor::OffsetLexicographicCompare&lt;VOffsetDimension&gt;’<br>

/usr/local/include/InsightToolkit/Common/itkOffset.h:221: error: previous definition of ‘class itk::Functor::OffsetLexicographicCompare&lt;VOffsetDimension&gt;’<br>
<br>
........<br>
.......<br>
/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<br>
make[2]: *** [CMakeFiles/blackTopHat2D.dir/blackTopHat2D.cxx.o] Error 1<br>
make[1]: *** [CMakeFiles/blackTopHat2D.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
************<br>
<br>
What am I doing wrong?<br>
Is there any specific detail/switch I must know about like<br>
in case  of &quot;with ITK_USE_CONSOLIDATED_MORPHOLOGY set to ON&quot;?<br>
<br>
Thanks for your help,<br>
<br>
Alex<br>
<br>
<br>
Luis Ibanez wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Hi Oleksander,<br>
<br>
<br>
1) What ITK version are you using ?<br>
<br>
2) Please note that you must configure ITK with<br>
    ITK_USE_CONSOLIDATED_MORPHOLOGY<br>
    set to ON, in order to use that class.<br>
<br>
<br>
    Regards,<br>
<br>
<br>
          Luis<br>
<br>
<br>
----------------------------------------------------------------<br></div><div><div></div><div class="h5">
On Fri, Sep 17, 2010 at 4:50 PM, Oleksandr Dzyubak &lt;<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a> &lt;mailto:<a href="mailto:adzyubak@gmail.com" target="_blank">adzyubak@gmail.com</a>&gt;&gt; wrote:<br>

<br>
<br>
    Dear IT users,<br>
<br>
    I just tried to compile the example from ITK<br>
    itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx<br>
    and got a compilation error below.<br>
<br>
<br>
    **********<br>
    dzyubak@debian-alex: /BUILD$ make<br>
    [100%] Building CXX object<br>
    CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx.o<br>
    In file included from<br>
    /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.txx:20,<br>
    from<br>
    /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:159,<br>
    from<br>
    /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Closing/2D/Src/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx:22:<br>
    /usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.h:56:<br>
    error: redefinition of ‘class<br>
    itk::GrayscaleMorphologicalClosingImageFilter&lt;TInputImage,<br>
    TOutputImage, TKernel&gt;’<br>
    /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:53:<br>
    error: previous definition of ‘class<br>
    itk::GrayscaleMorphologicalClosingImageFilter&lt;TInputImage,<br>
    TOutputImage, TKernel&gt;’<br>
    In file included from<br>
    /usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.h:155,<br>
    from<br>
    /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.txx:20,<br>
    from<br>
    /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:159,<br>
    from<br>
    /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Closing/2D/Src/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx:22:<br>
<br>
    .....<br>
    etc...<br>
    .....<br>
<br>
    /usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.txx:147:<br>
    error: ‘void<br>
    itk::GrayscaleMorphologicalClosingImageFilter&lt;TInputImage,<br>
    TOutputImage, TKernel&gt;::PrintSelf(std::ostream&amp;, itk::Indent)<br>
    const’ previously declared here<br>
    make[2]: ***<br>
    [CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx.o]<br>
    Error 1<br>
    make[1]: ***<br>
    [CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/all]<br>
    Error 2<br>
    make: *** [all] Error 2<br>
    dzyubak@debian-alex: /BUILD$<br>
    *********<br>
<br>
    Is this a bug?<br>
<br>
    After digging the header and template files,<br>
    I found that all those errors could be fixed<br>
    by making corrections in the template file<br>
    &quot;itkOptGrayscaleMorphologicalClosingImageFilter.txx&quot; as below.<br>
<br>
    // #include &quot;itkGrayscaleMorphologicalClosingImageFilter.h&quot;<br>
    #include &quot;itkOptGrayscaleMorphologicalClosingImageFilter.h&quot;<br>
<br>
    As I can see, similar corrections should be done in the template<br>
    itkOptGrayscaleMorphologicalOpeningImageFilter.txx as well<br>
<br>
    // #include &quot;itkGrayscaleMorphologicalOpeningImageFilter.h&quot;<br>
    #include &quot;itkOptGrayscaleMorphologicalOpeningImageFilter.h&quot;<br>
<br>
    Regards,<br>
<br>
    Alex<br>
<br>
    _____________________________________<br></div></div>
    Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> &lt;<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>&gt;<div class="im"><br>
<br>
    Visit other Kitware open-source projects at<br>
    <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
    Kitware offers ITK Training Courses, for more information visit:<br>
    <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
    Please keep messages on-topic and check the ITK FAQ at:<br>
    <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
    Follow this link to subscribe/unsubscribe:<br>
    <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>