[vtkusers] Storing mixed types in an ImageData

David Doria daviddoria+vtk at gmail.com
Wed Dec 2 08:09:05 EST 2009


There are functions to change the type of all components, e.g.
vtkImageData::SetScalarTypeToUnsignedChar( )

but is it possible to store different types, say a double and an
unsigned char, in every index of an ImageData?

Also, to set values, there seems to only be
SetScalarComponentFromDouble. If you are setting an unsigned char, do
you have to cast it when you set the value, like:
unsigned char c;
SetScalarComponentFromDouble((double)c);
?

That seems a bit awkward/silly unless I'm missing something.

Thanks,

David



More information about the vtkusers mailing list