I am wondering if it could be interesting to add a function to vtkColorTransferFunction to define a specific float value to act as Nan values.
Nan values are indeed perfectly well handled by the lookup.setNanColor() function.
A typical case, I have to figure out is read and represent variables from netCDF files. In this format, an attribut specify the missing value to be considered for each variables. This floating value is not a Nan but rather a value taken outside the range of the variable.
For example, if the range of the variable is -100:100 then a missing value could be set to -1E+34
Now when you want to set up a lookup table in VTK to handle this case, you need to transform all values equal to the missing value (-1E+34) to Nan. This operation has a cost of course (filter all points, compare and replace if needed) and could be avoided if a setValueAsNan() function would exist.
Let me know, if this a bad idea or a good request.