[Insight-developers] fast image pixel access method

Gao, Yi gaoyi.cn at gmail.com
Sun May 12 21:43:43 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130512/743611e0/attachment.htm>


More information about the Insight-developers mailing list