[vtkusers] Scalars (double vs float).

Victor Levy vlevy at myrealbox.com
Fri May 4 08:46:47 EDT 2001


Simon,

> However looking at other classes, (vtkContourFilter for example)
> the the data type to set ranges etc are always floats.

vtkContourFilter converts its input data to float, no matter what the scalar data type, even if it's a single bit per scalar.  The
key is to make sure you call your vtkStructuredPoints object's SetScalarType to let it know the correct scalar type of your
vtkScalars object.  I have not tried using "double" scalars, just 1-bit, 8-bit, and 16-bit integers.  In my experience
vtkKitwareContourFilter does not seem to handle the single-bit case but vtkContourFilter does.

Hope this helps, Vic

----- Original Message -----
From: Simon Bulman
To: vtkusers at public.kitware.com
Sent: Friday, May 04, 2001 6:33 AM
Subject: [vtkusers] Scalars (double vs float).


Hi All,

>From the documentation I see that vtkScalars etc. allow you to use a certain datatype i.e.
float, double. However looking at other classes, (vtkContourFilter for example) the the data type
to set ranges etc are always floats. Is it the intention of vtk to eventually enable these to be
datatype dependent? Is this already done but not documented.?

What do other people do when they have data that need double precision? I ask because I seem
to be having problems creating iso surfaces with my data and the only thing that can explain this
seems to be data truncation etc

Any thoughts??

Simon

================================
S.D.Bulman.
Senior Research Officer.
University of Wales Swansea.

S.D.Bulman at swansea.ac.uk

(W) +44 (0)1792 513179
(H)  +44 (0)1792 511144
================================





More information about the vtkusers mailing list