I would think an itk::NeighborhoodIterator with a radius of [1,1,1] would
do.  Are there any requirements other than direct adjacency to the
neighborhood you want to traverse?

I haven't looked closely at the code but I think it's about as well
optimized as it could be.
--
Kent Williams [email protected]






On 5/12/13 8:43 PM, "Gao, Yi" <[email protected]> wrote:

>Dear all,
>
>
>Could I have some suggestions on ways to fast access the nerighbors of a
>set of random voxels? The scenario is as follows:
>
>
>I have to access some voxels in the volume, these voxels are quite
>randomly distributed. For each of them I know their (x, y, z) indexes.
>
>At each of these voxel, I need to access all its 26 neighbors. I want
>this step to be faster.
>
>
>So i'm hoping to have something like:
>
>
>1. for each (x, y, z), I get the pointer to that voxel: ptr.
>
>2. For each of its neighbors, I use things like ptr[1], ptr[nx], ptr[1+
>nx*ny] to access (x+1, y, z), (x, y+1, z) and (x+1, y, z+1)....
>
>
>Could I know if there is some good way to do that?
>
>Thank you in advance for any hint!
>
>Best,
>yi
>



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the 
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and 
may be legally privileged.  If you are not the intended recipient, you are 
hereby notified that any retention, dissemination, distribution, or copying of 
this communication is strictly prohibited.  Please reply to the sender that you 
have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

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-developers

Reply via email to