<div dir="ltr"><div><div><div>You misspelled the filter name:<br>  typedef itk::BinaryFillHoleImageFilter&lt;Binary2DImageType&gt; HoleFillFilterType;<br><br>should be<br> typedef itk::BinaryFillholeImageFilter&lt;Binary2DImageType&gt; HoleFillFilterType;<br>
<br></div>FillHole -&gt; Fillhole<br><br></div>Thanks for providing a complete example and cmake file. It saves all of us a lot of time...<br><br></div>Bill<br><br><div><div><div><br></div></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Jun 16, 2013 at 7:16 PM, dakai <span dir="ltr">&lt;<a href="mailto:wang.hongkai@gmail.com" target="_blank">wang.hongkai@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
Maybe this question is week, but I cannot figure out the answer. I am using<br>
ITK4.4, Microsoft Visual Studio Professional 2012 in windows 8. I built<br>
ITK4.4 using Cmake 2.8.11.1 without problem. Then I tried to compile my own<br>
exe using the itkBinaryFillHoleImageFilter, and Visual Studio told me:<br>
&quot;error C2039: &#39;BinaryFillHoleImageFilter&#39; : is not a member of &#39;itk&#39;&quot;.<br>
Actually, before the compilation, visual studio already told me the line<br>
&quot;typedef itk::BinaryFillHoleImageFilter&lt;Binary2DImageType&gt;<br>
HoleFillFilterType;&quot; has problem:&quot;Error: qualified name not allowed.&quot;<br>
<br>
I also tried other filters under ITK\Modules\Filtering\LabelMap\, and they<br>
have the same problem.<br>
<br>
I know the filters under ITK\Modules\Filtering\LabelMap\ all came from<br>
Gaëtan&#39;s contribution<br>
(<a href="http://www.insight-journal.org/browse/publication/176" target="_blank">http://www.insight-journal.org/browse/publication/176</a>), but as I googled<br>
itkBinaryFillHoleImageFilter, it seems nobody had the same problem as mine.<br>
<br>
My codes and cmake file are as below.<br>
<br>
Thank you!<br>
<br>
Hongkai<br>
<br>
<br>
#include &lt;fstream&gt;<br>
#include &quot;itkImage.h&quot;<br>
#include &quot;itkBinaryThresholdImageFilter.h&quot;<br>
#include &quot;itkSliceBySliceImageFilter.h&quot;<br>
#include &quot;itkBinaryFillholeImageFilter.h&quot;<br>
#include &quot;itkImageFileReader.h&quot;<br>
#include &quot;itkImageFileWriter.h&quot;<br>
#include &quot;stdlib.h&quot;<br>
<br>
int main(int argc, char *argv[] )<br>
{<br>
<br>
  const  unsigned int   Dimension = 3;<br>
  typedef   float  InputPixelType;<br>
  typedef   unsigned char  BinaryPixelType;<br>
  typedef   float  OutputPixelType;<br>
  typedef itk::Image&lt; InputPixelType,  Dimension &gt;   InputImageType;<br>
  typedef itk::Image&lt; BinaryPixelType,  Dimension &gt;   BinaryImageType;<br>
  typedef itk::Image&lt; BinaryPixelType,  2 &gt;   Binary2DImageType;<br>
  typedef itk::Image&lt; OutputPixelType, Dimension &gt;   OutputImageType;<br>
<br>
  typedef itk::ImageFileReader&lt; InputImageType  &gt;  ReaderType;<br>
  typedef itk::ImageFileWriter&lt; BinaryImageType &gt;  WriterType;<br>
  ReaderType::Pointer reader = ReaderType::New();<br>
  WriterType::Pointer writer = WriterType::New();<br>
  reader-&gt;SetFileName( argv[1] );<br>
  writer-&gt;SetFileName( argv[2] );<br>
  reader-&gt;Update();<br>
<br>
<br>
  //----------- Thresholding filter -------------------------------//<br>
  typedef itk::BinaryThresholdImageFilter&lt; InputImageType, BinaryImageType &gt;<br>
ThresholdFilterType;<br>
  ThresholdFilterType::Pointer ThresholdFilter = ThresholdFilterType::New();<br>
  ThresholdFilter-&gt;SetOutsideValue( 0 );<br>
  ThresholdFilter-&gt;SetInsideValue( 1 );<br>
  ThresholdFilter-&gt;SetLowerThreshold( -100 );<br>
  ThresholdFilter-&gt;SetUpperThreshold( 1e30 );<br>
<br>
  //------------ Slice by slice filling holes -----------------------//<br>
  typedef itk::SliceBySliceImageFilter&lt; BinaryImageType, BinaryImageType&gt;<br>
SbSFilterType;<br>
  SbSFilterType::Pointer SbSFilter = SbSFilterType::New();<br>
<br>
  typedef itk::BinaryFillHoleImageFilter&lt;Binary2DImageType&gt;<br>
HoleFillFilterType;<br>
  HoleFillFilterType::Pointer HoleFillFilter = HoleFillFilterType::New();<br>
  SbSFilter-&gt;SetFilter(HoleFillFilter);<br>
<br>
<br>
  //Assemble the processing pipeline<br>
  ThresholdFilter-&gt;SetInput( reader-&gt;GetOutput() );<br>
  SbSFilter-&gt;SetInput(ThresholdFilter-&gt;GetOutput());<br>
  writer-&gt;SetInput(SbSFilter-&gt;GetOutput() );<br>
  writer-&gt;Update();<br>
<br>
  return EXIT_SUCCESS;<br>
<br>
}<br>
<br>
<br>
<br>
CMake list:<br>
PROJECT(MyProject)<br>
<br>
FIND_PACKAGE(ITK)<br>
<br>
IF(ITK_FOUND)<br>
  INCLUDE(${ITK_USE_FILE})<br>
ELSE(ITK_FOUND)<br>
  MESSAGE(FATAL_ERROR<br>
  &quot;ITK not found. Please set ITK_DIR.&quot;)<br>
ENDIF(ITK_FOUND)<br>
<br>
ADD_EXECUTABLE(MyProject MyProject.cxx )<br>
TARGET_LINK_LIBRARIES(MyProject<br>
  ${ITK_LIBRARIES}<br>
  )<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-users.7.n7.nabble.com/BinaryFillHoleImageFilter-not-recognized-as-a-member-of-itk-tp31707.html" target="_blank">http://itk-users.7.n7.nabble.com/BinaryFillHoleImageFilter-not-recognized-as-a-member-of-itk-tp31707.html</a><br>

Sent from the ITK - Users mailing list archive at Nabble.com.<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.php" target="_blank">http://www.kitware.com/products/protraining.php</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><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>