[vtk-developers] isnan

Michael Halle mhalle at bwh.harvard.edu
Sat Jan 13 08:20:27 EST 2007


I've got a dataset that uses NaN as a data value to indicate invalid pixels. A couple of places in VTK, such as vtkDataArray's GetRange() are fooled by this value.  A small test for NaN pixels would fix this problem, and native isnan() and std::isnan() don't seem to introduce significant preformance hits. (vtkDataArray could also possibly keep track of the existence of NaN values to help other classes know how to deal with them).

However, there's currently no supported text for isnan() in VTK.

Where should the NaN test be implemented, though?  vtkMath is one choice.  C++ now puts it in std, so a case could be made for creating a vtkstd::isnan() for consistency. It would be nice to maintain the efficiency of the original function.

Thanks for any guidance!

--Mike






More information about the vtk-developers mailing list