<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hello<BR>
this example in python can likely help you:<BR>
<BR><FONT face="Courier New" color=#1a1a70 size=3>
<P align=left>vtkUnsignedCharArray *array = vtkUnsignedCharArray::New();</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70 size=1><FONT size=3>array->SetVoidArray( data, size[0]*size[1]*size[2],1);</FONT></FONT></P>
<P align=left><FONT face="Courier New" color=#1a1a70 size=3></FONT> </P><FONT face="Courier New" color=#1a1a70 size=1><FONT size=3><FONT face="Courier New" color=#1a1a70 size=3>
<P align=left>imageData = vtklmageData::New();</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData->GetPointData()->SetScalars(array) ;</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData->SetDimensions(size) ;</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData->SetScalarType(VTK_UNSIGNED_CHAR) ;</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData->SetSpacing(l.0, 1.0, 1.0 );</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70 size=2><FONT size=3>imageData->SetOrigin(0.0, 0.0, 0.0 );</FONT></P></FONT></FONT></FONT>
<BR>
> Date: Sat, 22 Dec 2007 02:47:47 -0800<BR>> From: subhas_vtk@yahoo.com<BR>> To: vtkusers@vtk.org<BR>> Subject: [vtkusers] Store a BMP image in a uchar array<BR>> <BR>> Hi<BR>> I am a novice to VTK. I am able to read a VTK<BR>> File and able to display through imageActor. May I<BR>> know how to store the bmp image content in a uchar<BR>> array.<BR>> Please find below my code. <BR>> <BR>> Regards<BR>> Subhas <BR>> <BR>> vtkBMPReader *bmpReader = vtkBMPReader::New();<BR>> bmpReader->SetFileName("/home/subhas/software/VTK/MyExamples/masonry.bmp");<BR>> bmpReader->Update();<BR>> <BR>> <BR>> <BR>> <BR>> <BR>> <BR>> vtkImageActor *imageActor = vtkImageActor::New();<BR>> imageActor->SetInput( bmpReader->GetOutput() );<BR>> <BR>> <BR>> vtkImageData *imageData = imageActor->GetInput();<BR>> <BR>> vtkUnsignedCharArray <BR>> *array = vtkUnsignedCharArray::New();<BR>> <BR>> <BR>> <BR>> <BR>> ____________________________________________________________________________________<BR>> Looking for last minute shopping deals? <BR>> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping<BR>> <BR>> _______________________________________________<BR>> This is the private VTK discussion list. <BR>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>> Follow this link to subscribe/unsubscribe:<BR>> http://www.vtk.org/mailman/listinfo/vtkusers<BR><BR><br /><hr />Sigue de cerca las últimas tendencias y lo que más rompe <a href='http://video.msn.com/video.aspx?mkt=es-es' target='_new'>MSN Vídeo</a></body>
</html>