Hi Luis,<br><br>I've extended the Level Set deformable registration algorithm from 2D to the 3D case, including the deformation field generation.&nbsp; How would I go about accessing each of the voxels in the image, then accessing each of the 3 vector components within each voxel?&nbsp; I know it has something to do with the iterator, as coded below:
<br><br><span style="font-style: italic;">typedef itk::ImageRegionConstIterator&lt; VectorImage3D1Type &gt; Iterator3D1Type;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">
&nbsp; typedef itk::ImageRegionIterator&lt; VectorImage3D2Type &gt; Iterator3D2Type;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp; Iterator3D1Type&nbsp; it2( vectorImage3D1, region3D1 );
</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp; Iterator3D2Type&nbsp; it3( vectorImage3D2, region3D2 );</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">
&nbsp; it2.GoToBegin();</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp; it3.GoToBegin();</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp; Vector3D1Type vector3D1;
</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp; Vector3D2Type vector3D2;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"></span><span style="font-style: italic;">
&nbsp; while( !it2.IsAtEnd() )</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; {</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; vector3D1 = it2.Get();</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; vector3D2[0] = vector3D1[0];&nbsp; </span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; vector3D2[1] = vector3D1[1];&nbsp; </span><br style="font-style: italic;"><span style="font-style: italic;">
&nbsp;&nbsp;&nbsp; vector3D2[2] = vector3D1[2];</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; it3.Set( vector3D2 );</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; ++it2;</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; ++it3;</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; }<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>