<DIV>Hi all,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I've problem using vtkImageAppend with vtkImageClip in a small loop.&nbsp; Here is my code fragment:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;extents = this-&gt;imageAppend-&gt;GetOutput()-&gt;GetExtent();</DIV>
<DIV>&nbsp;for (tempIndex = 0; tempIndex &lt; this-&gt;currZIndex; tempIndex++){<BR>&nbsp;&nbsp;extents[4] = tempIndex;<BR>&nbsp;&nbsp;extents[5] = tempIndex;</DIV>
<DIV>&nbsp;&nbsp;vtkImageData *dispImgDataTrk = vtkImageData::New();<BR>&nbsp;&nbsp;clipImage(this-&gt;imageAppend-&gt;GetOutput(), extents, &amp;(dispImgDataTrk));<BR>&nbsp;&nbsp;dim = dispImgDataTrk-&gt;GetDimensions();<BR>&nbsp;&nbsp;uscData = (unsigned char *)dispImgDataTrk-&gt;GetScalarPointer();<BR>&nbsp;&nbsp;convertUSCToFloatImageData(uscData, dim, &amp;tempData);<BR>&nbsp;&nbsp;tempMat = (float *)tempData-&gt;GetScalarPointer();<BR>&nbsp;&nbsp;sum = sumMat(tempMat, dim);</DIV>
<DIV>&nbsp;&nbsp;dispImgDataTrk-&gt;Delete();<BR>&nbsp;&nbsp;sprintf(testStr, "dim: %d, %d, %d, sum: %f", dim[0], dim[1], dim[2], sum);<BR>&nbsp;&nbsp;AfxMessageBox(testStr);<BR>&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>Assuming the imageAppend already has a volume built, this code fragment, goes through the volume one slice at a time;&nbsp;I tried to print the sum of all the pixels to verify.&nbsp; However, this code seems not to work.&nbsp; Though the extents are changed while clipping, the output of vtkImageClip always returns the data stored in z = 0; Is there something I should do before I use vtkImageAppend in a loop like this?&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>I've used document/view arch. in MFC to do this.&nbsp; When I advance through the slice one at a time in the view (the vtkImageAppend is maintained in the doc.), it seems to have no problem.&nbsp; When I access the same volume in a loop, like the one shown above, it always returns the z=0 level.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I appreciate any inputs on this.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Madhu.</DIV><p>
                <hr size=1>Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/50x/*http://promotions.yahoo.com/new_mail/static/efficiency.html">Yahoo! Mail</a> - 50x more storage than other providers!