[vtkusers] Changing scalar type in vtkStructuredPoints

Adam D. Burry aburry at igotechnologies.com
Thu Dec 13 13:19:32 EST 2001


Hi:

Again, this question has been asked before:
	http://public.kitware.com/pipermail/vtkusers/2001-June/006563.html

I want to convert the scalar type in my vtkStructuredPoints data set to
VTK_UNSIGNED_CHAR.

My pipeline looks something like this:

vtkActor                              // something to render on the
screen
    vtkTexture                        // use the slice as a texture
        vtkExtractVOI                 // pull out a slice
            vtkImageConstantPad       // make volume a power of 2
                vtkVolumeReader       // read the slices from disk
    vtkMapper                         // mapper to do whatever mappers
do
        vtkPlaneSource                // plane to position texture

In addition to this pipeline, I have the LookupTable I want to use.

Somewhere between vtkVolumeReader and vtkExtractVOI I would like to
convert the vtkStructuredPoints data to VTK_UNSIGNED_CHAR. I would like
to do this because I actually pull several textures out of the volume
and I do not want to do the colour mapping every time.

The following methods look potentially useful:
	vtkScalarsToColors::MapScalarsThroughTable()
	vtkDataSetAttributes::GetScalars()/SetScalars()
	vtkDataSet::GetPointData()

Is there a filter I can stick in to do the data type conversion using
the LookupTable, or do I write one? Or is there another approach?

Thanks.

--
Mr. Adam D. Burry, Software Developer
aburry at igotechnologies.com



More information about the vtkusers mailing list