[vtkusers] Store a BMP image in a uchar array
Jose David Pfuturi Huisa
daviddarkzero at hotmail.com
Wed Dec 26 13:00:23 EST 2007
Hello
this example in python can likely help you:
vtkUnsignedCharArray *array = vtkUnsignedCharArray::New();
array->SetVoidArray( data, size[0]*size[1]*size[2],1);
imageData = vtklmageData::New();
imageData->GetPointData()->SetScalars(array) ;
imageData->SetDimensions(size) ;
imageData->SetScalarType(VTK_UNSIGNED_CHAR) ;
imageData->SetSpacing(l.0, 1.0, 1.0 );
imageData->SetOrigin(0.0, 0.0, 0.0 );
> Date: Sat, 22 Dec 2007 02:47:47 -0800> From: subhas_vtk at yahoo.com> To: vtkusers at vtk.org> Subject: [vtkusers] Store a BMP image in a uchar array> > Hi> I am a novice to VTK. I am able to read a VTK> File and able to display through imageActor. May I> know how to store the bmp image content in a uchar> array.> Please find below my code. > > Regards> Subhas > > vtkBMPReader *bmpReader = vtkBMPReader::New();> bmpReader->SetFileName("/home/subhas/software/VTK/MyExamples/masonry.bmp");> bmpReader->Update();> > > > > > > vtkImageActor *imageActor = vtkImageActor::New();> imageActor->SetInput( bmpReader->GetOutput() );> > > vtkImageData *imageData = imageActor->GetInput();> > vtkUnsignedCharArray > *array = vtkUnsignedCharArray::New();> > > > > ____________________________________________________________________________________> Looking for last minute shopping deals? > Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping> > _______________________________________________> This is the private VTK discussion list. > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ> Follow this link to subscribe/unsubscribe:> http://www.vtk.org/mailman/listinfo/vtkusers
_________________________________________________________________
Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar siempre a la última
Guapos y guapas, clips musicales y estrenos de cine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071226/c4ec1986/attachment.htm>
More information about the vtkusers
mailing list