[vtk-developers] Speeding up raycasting on x86
Lisa Avila
lisa.avila at kitware.com
Thu Jul 11 17:05:59 EDT 2002
>2) It's not completely correct. Tests I ran not too long ago show that the
>process causes the value
>to be *rounded*, but this is not readily apparent because the rounding is,
>in this case, not to the
>nearest int but to the nearest fraction of 1/2**16. So, for example, a
>value greater than (3.0 -
>1/2**16), but less than 3.0, will be rounded up to 3. This problem
>becomes very readily apparent if
>you tweak the values so that you use the full 32 bits for the integer
>portion and don't reserve any
>bits for fixed point fractional values, thus causing rounding to the
>nearest integer.
Being "not completely correct" may cause big problems in the ray caster. It
relies on the fact that at the far boundary of the ray the coordinates
along the ray cannot meet or exceed the dimensions of the data minus one.
For example, if your data is 512 samples in x, the x coordinate can never
be 511 or greater (since this will cause a neighboring voxel that doesn't
exist to be visited for trilinear interpolation). We ensure that we never
reach 511 by subtracting a bit off of it (to avoid precision issues) Now it
may be that the bit that we subtract off is sufficiently larger than
1/65536 that this won't be a problem, but we'd better check into this
before making the change. I don't think the VTK tests of ray casting
exercise this class enough to say that everything is fine just because the
tests pass....
Lisa
More information about the vtk-developers
mailing list