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 class="gmail_quote">On Fri, Sep 17, 2010 at 4:50 PM, Oleksandr Dzyubak <span dir="ltr"><<a href="mailto:adzyubak@gmail.com">adzyubak@gmail.com</a>></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>
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 CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx.o<br>
In file included from /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.txx:20,<br>
from /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:159,<br>
from /mnt/Public/Programs/ITK_Test/Morphology/Consolidated_morphology/Closing/2D/Src/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx:22:<br>
/usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.h:56: error: redefinition of ‘class itk::GrayscaleMorphologicalClosingImageFilter<TInputImage, TOutputImage, TKernel>’<br>
/usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:53: error: previous definition of ‘class itk::GrayscaleMorphologicalClosingImageFilter<TInputImage, TOutputImage, TKernel>’<br>
In file included from /usr/local/include/InsightToolkit/BasicFilters/itkGrayscaleMorphologicalClosingImageFilter.h:155,<br>
from /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.txx:20,<br>
from /usr/local/include/InsightToolkit/Review/itkOptGrayscaleMorphologicalClosingImageFilter.h:159,<br>
from /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: error: ‘void itk::GrayscaleMorphologicalClosingImageFilter<TInputImage, TOutputImage, TKernel>::PrintSelf(std::ostream&, itk::Indent) const’ previously declared here<br>
make[2]: *** [CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.cxx.o] Error 1<br>
make[1]: *** [CMakeFiles/itkMapOptGrayscaleMorphologicalClosingImageFilterTest.dir/all] 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>
"itkOptGrayscaleMorphologicalClosingImageFilter.txx" as below.<br>
<br>
// #include "itkGrayscaleMorphologicalClosingImageFilter.h"<br>
#include "itkOptGrayscaleMorphologicalClosingImageFilter.h"<br>
<br>
As I can see, similar corrections should be done in the template<br>
itkOptGrayscaleMorphologicalOpeningImageFilter.txx as well<br>
<br>
// #include "itkGrayscaleMorphologicalOpeningImageFilter.h"<br>
#include "itkOptGrayscaleMorphologicalOpeningImageFilter.h"<br>
<br>
Regards,<br>
<br>
Alex<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><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>
</blockquote></div><br>