[Insight-users] Re-Submitting simple question - somebody please answer
Luis Ibanez
luis.ibanez at kitware.com
Tue Jun 30 13:43:34 EDT 2009
Hi Asamwm,
Here is the pseudo-code of what you may want to do
A) Initialize the image:
This includes calling
a) SetRegions()
b) Allocate()
c) SetOrigin()
d) SetSpacing()
e) SetDirection
if you have an example image, you can get
(c,d,e) by calling CopyInformation( exampleImage).
B) At every iteration, of your relabeling
you just need to call
FillBuffer( 0 )
there is no need for you to reallocate the image.
Regards,
Luis
-----------------------------------------
On Wed, Jun 24, 2009 at 5:31 PM, asamwm <asamwm at gmail.com> wrote:
> Hi all,
> I sent this question last week but did not receive any answer yet.
>
> Rephrasing:
>
> I create a binary itk image (3D) and fill it manually in order to do
> connected components.
> This process iterates several times and
> in each iteration I need the binary image to be reset to all zeros.
>
> Q: which way is more efficient?
> 1- image->Initialize() > If so, do I still need to SetRegions() and
> allocate() ?
> 2- FillBuffer(0), but that would probably iterate through the entire 3D
> stack..
> 3- Or should I keep track of the pixels from the previous iteration
> so I can reset them manually?
>
> Thanks.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090630/3febbf51/attachment.htm>
More information about the Insight-users
mailing list