<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:'Times New Roman', Times, serif;" dir="ltr">
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<div id="divRplyFwdMsg" dir="ltr"><br>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:'Times New Roman',Times,serif">
<div style="color:rgb(0,0,0)">
<div id="divRplyFwdMsg" dir="ltr">
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:'Times New Roman',Times,serif">
<p><font face="Times New Roman, sans-serif" style="color:rgb(33,33,33); font-size:15px">Dear ITK-users,</font><span style="color:rgb(33,33,33); font-size:15px"></span></p>
<div style="color:rgb(33,33,33); font-size:15px"><font face="Times New Roman, sans-serif"><br>
</font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px">I tried to adopt the BinaryFillholeImageFilter for 3D image </span></font><font color="#212121"><span style="font-size:15px">(contour.mha). Unfortunately,  the
 result which I obtained is not what I expect.</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px"><br>
</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px">The fragment of  code which I used is :</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px"><br>
</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px">                                                // Lecture of the contour.mha</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px">                                               <span style="color:rgb(33,33,33); font-family:"Times New Roman",sans-serif; font-size:15px"> </span><span style="color:rgb(33,33,33); font-family:"Times New Roman",sans-serif; font-size:15px">typedef
 itk::Image< unsigned char, 3 > UCharImageType;</span>
<div>                                               typedef itk::ImageFileReader<<span style="color:rgb(33,33,33); font-family:"Times New Roman",sans-serif; font-size:15px">UCharImageType</span>> ImageReaderType;</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>                                       ImageReaderType::Pointer reader = ImageReaderType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>                                        reader->SetFileName("contour.mha"); </div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>                                        reader->Update();</div>
</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px"><br>
</span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px">                                               // Binary Fill Hole Image Filter<span></span></span></font></font></div>
<div><font face="Times New Roman, sans-serif"><font color="#212121"><span style="font-size:15px">
<div>                                                typedef itk::BinaryFillholeImageFilter< UCharImageType > FilterType;</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>FilterType::Pointer filter = FilterType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>filter->SetInput( reader->GetOutput() );</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>filter->SetForegroundValue( itk::NumericTraits< unsigned char >::min() );</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div></div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>filter->Update();</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div>                                                // Save the BinaryFillHoleImage</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>{</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>typedef itk::ImageFileWriter<UCharImageType> ImageWriterType;</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>ImageWriterType::Pointer writer = ImageWriterType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>writer->SetFileName("BinaryFillHoleImage.mha");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>writer->SetInput(filter->GetOutput());</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>try{</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>writer->Update();</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>}catch(itk::ExceptionObject &e){</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>std::cerr << e << std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>}</div>
<br>
</span></font></font></div>
<div style="color:rgb(33,33,33); font-size:15px"><br>
</div>
<div style="color:rgb(33,33,33); font-size:15px"><font face="Times New Roman, sans-serif"></font></div>
<div style="color:rgb(33,33,33); font-size:15px"><font face="Times New Roman, sans-serif"><br>
</font></div>
<div style="color:rgb(33,33,33); font-size:15px"><font face="Times New Roman, sans-serif">Thank you in advance.</font></div>
<div style="color:rgb(33,33,33); font-size:15px"><font face="Times New Roman, sans-serif"><br>
</font></div>
<div style="color:rgb(33,33,33); font-size:15px"><font face="Times New Roman, sans-serif">Kind regards,</font></div>
<br>
<p></p>
<p><br>
</p>
<div id="Signature"><font size="3" face="Garamond">Abdelkhalek Bakkari</font>
<div><span style="line-height:14px"><font size="3" face="Garamond">Ph.D candidate in Computer Science</font></span></div>
<div><span style="line-height:20.82666778564453px; background-color:rgb(255,255,255)"><font face="Garamond" size="3">Institute of Applied Computer Science</font></span></div>
<div><span style="line-height:18.399999618530273px"><font face="Garamond" size="3">Lodz University of Technology, Poland</font></span></div>
<div><span style="line-height:18.399999618530273px"><font face="Garamond" size="3"><br>
</font></span></div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>