Hello I have the next file:<br>______________________________<div>____________________________________<br><br># vtk DataFile Version 3.0<br>vtk output<br>ASCII<br>DATASET POLYDATA<br>POINTS 4 float<br>0 0 0<br>9 0 0<br>
0 9 0<br>
9 0 9<br>LINES 5 15<br>2 0 1<br>2 1 3<br>2 3 2<br>2 2 0<br>2 0 3<br>POINT_DATA 4<br>scalars pointvar float<br>LOOKUP_TABLE default<br>-1.2 -1.3 1.4 1.5<br>_______________________________________________________________________<br>
<br>How to normalized scalars pointvar to domain of [-1.0, 1.0] to
display in color values. The negative values blue, the positive values
red and the zeros values green.<br><br>I saw the next example <br><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/DataManipulation/Python/FinancialField.py" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/DataManipulation/Python/FinancialField.py</a><br>
but how can I apply this if I read the file?<br><br> calc = vtk.vtkArrayCalculator()<br> calc.SetInputConnection(rf.GetOutputPort())<br> calc.SetAttributeModeToUsePointData()<br> calc.AddScalarVariable("s", scalar, 0)<br>
calc.SetFunction("s / %f"%max)<br> calc.SetResultArrayName("resArray")<br><br>Regards<br><font color="#888888"><br>sergio<br></font></div>