[Insight-users] Deformation Field Iterator Type
Kevin Ming
ming.kevin at gmail.com
Mon Sep 11 16:33:54 EDT 2006
Hi Luis,
I've extended the Level Set deformable registration algorithm from 2D to the
3D case, including the deformation field generation. How would I go about
accessing each of the voxels in the image, then accessing each of the 3
vector components within each voxel? I know it has something to do with the
iterator, as coded below:
typedef itk::ImageRegionConstIterator< VectorImage3D1Type > Iterator3D1Type;
typedef itk::ImageRegionIterator< VectorImage3D2Type > Iterator3D2Type;
Iterator3D1Type it2( vectorImage3D1, region3D1 );
Iterator3D2Type it3( vectorImage3D2, region3D2 );
it2.GoToBegin();
it3.GoToBegin();
Vector3D1Type vector3D1;
Vector3D2Type vector3D2;
while( !it2.IsAtEnd() )
{
vector3D1 = it2.Get();
vector3D2[0] = vector3D1[0];
vector3D2[1] = vector3D1[1];
vector3D2[2] = vector3D1[2];
it3.Set( vector3D2 );
++it2;
++it3;
}
But how do I know which voxel the iterator is on (ie. where it is in the
image, in x,y,z components), especially when it's in 3D?
Thank you,
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060911/f3f30fad/attachment.htm
More information about the Insight-users
mailing list