<div dir="ltr"><div><div><div><div><div><div>Dear all,<br><br></div>Could I have some suggestions on ways to fast access the nerighbors of a set of random voxels? The scenario is as follows:<br><br></div>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.<br>
<br>At each of these voxel, I need to access all its 26 neighbors. I want this step to be faster.<br><br></div>So i'm hoping to have something like:<br><br></div>1. for each (x, y, z), I get the pointer to that voxel: ptr.<br>
</div>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)....<br><br></div>Could I know if there is some good way to do that?<br><br>Thank you in advance for any hint!<br>
<br>Best,<br>yi<br></div>