Hi Luis,<br><br>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:
<br><br><span style="font-style: italic;">typedef itk::ImageRegionConstIterator< VectorImage3D1Type > Iterator3D1Type;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">
typedef itk::ImageRegionIterator< VectorImage3D2Type > Iterator3D2Type;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> Iterator3D1Type it2( vectorImage3D1, region3D1 );
</span><br style="font-style: italic;"><span style="font-style: italic;"> Iterator3D2Type it3( vectorImage3D2, region3D2 );</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">
it2.GoToBegin();</span><br style="font-style: italic;"><span style="font-style: italic;"> it3.GoToBegin();</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> Vector3D1Type vector3D1;
</span><br style="font-style: italic;"><span style="font-style: italic;"> Vector3D2Type vector3D2;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"></span><span style="font-style: italic;">
while( !it2.IsAtEnd() )</span><br style="font-style: italic;"><span style="font-style: italic;"> {</span><br style="font-style: italic;"><span style="font-style: italic;"> vector3D1 = it2.Get();</span><br style="font-style: italic;">
<span style="font-style: italic;"> vector3D2[0] = vector3D1[0]; </span><br style="font-style: italic;"><span style="font-style: italic;"> vector3D2[1] = vector3D1[1]; </span><br style="font-style: italic;"><span style="font-style: italic;">
vector3D2[2] = vector3D1[2];</span><br style="font-style: italic;"><span style="font-style: italic;"> it3.Set( vector3D2 );</span><br style="font-style: italic;"><span style="font-style: italic;"> ++it2;</span><br style="font-style: italic;">
<span style="font-style: italic;"> ++it3;</span><br style="font-style: italic;"><span style="font-style: italic;"> }<br><span style="font-style: italic;"><br><span style="font-style: italic;"></span></span></span>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?
<br><br><br>Thank you,<br>Kevin<span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;"></span><br></span></span>