[vtkusers] How to use vtkImageImport class for RGB image

masabumi ishihara maty.ishihara at gmail.com
Tue Oct 28 02:59:14 EDT 2008


Hi VTK users,

I am a newbie for VTK.
I am tring to use vtkImageImport class in order to convert the
third-party image to the VTK 2D image, as follows;

    vtkImageImport *importer = vtkImageImport::New();
    importer->SetWholeExtent(0,siw-1,0,sih-1,0,0);
    importer->SetDataExtentToWholeExtent();
    importer->SetDataScalarTypeToShort();
    importer->SetImportVoidPointer(b);

BTW, if the void pointer b is scalar, it works well, but if b is RGB
color data, the error comes about.
If you know how to use vtkImageImport class for RGB image, please let me know.

Thanks,

Maty



More information about the vtkusers mailing list