<div>Hi,</div>
<div>&nbsp;</div>
<div>I am working with FixedPointVolumeRayCast and it seems to me that there is a mistake in the helper macros when incrementing the ray position.</div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">for example:</font></div>
<div>#define VTKKWRCHelper_MoveToNextSampleNN()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp; if ( k &lt; numSteps-1 )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<br>&nbsp;&nbsp;&nbsp; mapper-&gt;FixedPointIncrement( pos, dir );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; mapper-&gt;ShiftVectorDown( pos, spos );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; dptr = data +&nbsp; spos[0]*inc[0] + spos[1]*inc[1] + spos[2]*inc[2];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<br>&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>is called in <font size="2">FixedPointCompositeHelperGenerateImageOneSimpleNN</font></div>
<div><font size="2"></font>&nbsp;</div>
<div><font size="2">for( k=0; k&lt;numSteps; ++k)</font></div>
<div><font size="2">{</font></div>
<div><font size="2">&nbsp; if( k )</font></div>
<div><font size="2">&nbsp; {</font></div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; VTKKWRCHelper_MoveToNextSampleNN();</div>
<div>&nbsp; }</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp; // the rest of the loop computes the color value</div>
<div>&nbsp; ...</div>
<div>}</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>so if we have 3 steps in the ray, when k == 0 we compute the first sample value,</div>
<div>then k == 1 we move to second sample and compute the value,</div>
<div>and then k == 2 and instead of moving to third sample we stay at the same position and recompute the previous value.</div>
<div>&nbsp;</div>
<div>I think the condition in the macro should be:</div>
<div>if ( k &lt; numSteps )</div>
<div>&nbsp;</div>
<div>for all the VTKKWRCHelper_MoveToNextSample*** macros</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Is this true or am i missing something?</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>XR.</div>
<div>&nbsp;</div>