<div dir="ltr"><div><div><div>You misspelled the filter name:<br> typedef itk::BinaryFillHoleImageFilter<Binary2DImageType> HoleFillFilterType;<br><br>should be<br> typedef itk::BinaryFillholeImageFilter<Binary2DImageType> HoleFillFilterType;<br>
<br></div>FillHole -> 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"><<a href="mailto:wang.hongkai@gmail.com" target="_blank">wang.hongkai@gmail.com</a>></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>
"error C2039: 'BinaryFillHoleImageFilter' : is not a member of 'itk'".<br>
Actually, before the compilation, visual studio already told me the line<br>
"typedef itk::BinaryFillHoleImageFilter<Binary2DImageType><br>
HoleFillFilterType;" has problem:"Error: qualified name not allowed."<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'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 <fstream><br>
#include "itkImage.h"<br>
#include "itkBinaryThresholdImageFilter.h"<br>
#include "itkSliceBySliceImageFilter.h"<br>
#include "itkBinaryFillholeImageFilter.h"<br>
#include "itkImageFileReader.h"<br>
#include "itkImageFileWriter.h"<br>
#include "stdlib.h"<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< InputPixelType, Dimension > InputImageType;<br>
typedef itk::Image< BinaryPixelType, Dimension > BinaryImageType;<br>
typedef itk::Image< BinaryPixelType, 2 > Binary2DImageType;<br>
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;<br>
<br>
typedef itk::ImageFileReader< InputImageType > ReaderType;<br>
typedef itk::ImageFileWriter< BinaryImageType > WriterType;<br>
ReaderType::Pointer reader = ReaderType::New();<br>
WriterType::Pointer writer = WriterType::New();<br>
reader->SetFileName( argv[1] );<br>
writer->SetFileName( argv[2] );<br>
reader->Update();<br>
<br>
<br>
//----------- Thresholding filter -------------------------------//<br>
typedef itk::BinaryThresholdImageFilter< InputImageType, BinaryImageType ><br>
ThresholdFilterType;<br>
ThresholdFilterType::Pointer ThresholdFilter = ThresholdFilterType::New();<br>
ThresholdFilter->SetOutsideValue( 0 );<br>
ThresholdFilter->SetInsideValue( 1 );<br>
ThresholdFilter->SetLowerThreshold( -100 );<br>
ThresholdFilter->SetUpperThreshold( 1e30 );<br>
<br>
//------------ Slice by slice filling holes -----------------------//<br>
typedef itk::SliceBySliceImageFilter< BinaryImageType, BinaryImageType><br>
SbSFilterType;<br>
SbSFilterType::Pointer SbSFilter = SbSFilterType::New();<br>
<br>
typedef itk::BinaryFillHoleImageFilter<Binary2DImageType><br>
HoleFillFilterType;<br>
HoleFillFilterType::Pointer HoleFillFilter = HoleFillFilterType::New();<br>
SbSFilter->SetFilter(HoleFillFilter);<br>
<br>
<br>
//Assemble the processing pipeline<br>
ThresholdFilter->SetInput( reader->GetOutput() );<br>
SbSFilter->SetInput(ThresholdFilter->GetOutput());<br>
writer->SetInput(SbSFilter->GetOutput() );<br>
writer->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>
"ITK not found. Please set ITK_DIR.")<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>