If you want to move the iterator to a voxel position in the neighborhood of the current voxel, you can use the following:
// along X, then move along Y, then Z ...
iter.nextXYZ();
// Move to the next voxel along Z
iter.nextZXY();
// Move to previous voxel along Y
iter.prevYZX();
The iterator can also be moved to any voxel that is a relative position away from the current. For example, to move the iterator to another voxel at say
from the current position:
The iterator can also be moved to any position in a volume using:
if (ret == false)
std::cout « "moveTo failed. Moving outside volume?" « std::endl;
The moveTo function takes a position in the volume coordinates and moves the iterator to the new position if the position is valid. That is, the given position must be inside the bounds of the volume. If it fails to move, it returns false, else it returns true. It should be noted that moving iterators may not be very effecient and should be avoided as much as possible. The OpenVL iterators are always optimized for accessing and moving within the immediate neighborhood of a voxel.