<br>Hi Asamwm,<br><br>Here is the pseudo-code of what you may want to do<br><br> A) Initialize the image: <br> This includes calling<br><br> a) SetRegions()<br> b) Allocate()<br> c) SetOrigin()<br>
d) SetSpacing()<br> e) SetDirection<br><br> if you have an example image, you can get<br> (c,d,e) by calling CopyInformation( exampleImage).<br><br><br> B) At every iteration, of your relabeling <br>
you just need to call<br><br> FillBuffer( 0 )<br><br> there is no need for you to reallocate the image.<br><br><br><br> Regards,<br><br><br> Luis<br><br><br><br>-----------------------------------------<br>
<div class="gmail_quote">On Wed, Jun 24, 2009 at 5:31 PM, asamwm <span dir="ltr"><<a href="mailto:asamwm@gmail.com">asamwm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>I sent this question last week but did not receive any answer yet.<br><br>Rephrasing:<br><br>I create a binary itk image (3D) and fill it manually in order to do connected components.<br>This process iterates several times and <br>
in each iteration I need the binary image to be reset to all zeros.<br><br>Q: which way is more efficient?<br> 1- image->Initialize() > If so, do I still need to SetRegions() and allocate() ? <br> 2- FillBuffer(0), but that would probably iterate through the entire 3D stack..<br>
3- Or should I keep track of the pixels from the previous iteration<br> so I can reset them manually?<br><br>Thanks.<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>
Please keep messages on-topic and check the ITK FAQ at: <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></blockquote></div><br>