[vtkusers] error in vtkFixedPointVolumeRayCastHelper MoveToNextSample macros ?
xabi riobe
xabivtk at gmail.com
Wed Jun 6 10:19:05 EDT 2007
Hi,
I am working with FixedPointVolumeRayCast and it seems to me that there is a
mistake in the helper macros when incrementing the ray position.
for example:
#define
VTKKWRCHelper_MoveToNextSampleNN() \
if ( k < numSteps-1
) \
{
\
mapper->FixedPointIncrement( pos, dir
); \
mapper->ShiftVectorDown( pos, spos
); \
dptr = data + spos[0]*inc[0] + spos[1]*inc[1] +
spos[2]*inc[2]; \
}
is called in FixedPointCompositeHelperGenerateImageOneSimpleNN
for( k=0; k<numSteps; ++k)
{
if( k )
{
VTKKWRCHelper_MoveToNextSampleNN();
}
// the rest of the loop computes the color value
...
}
so if we have 3 steps in the ray, when k == 0 we compute the first sample
value,
then k == 1 we move to second sample and compute the value,
and then k == 2 and instead of moving to third sample we stay at the same
position and recompute the previous value.
I think the condition in the macro should be:
if ( k < numSteps )
for all the VTKKWRCHelper_MoveToNextSample*** macros
Is this true or am i missing something?
XR.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070606/65715cde/attachment.htm>
More information about the vtkusers
mailing list