<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&nbsp;can likely help&nbsp;you:<BR>
&nbsp;<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-&gt;SetVoidArray( data, size[0]*size[1]*size[2],1);</FONT></FONT></P>
<P align=left><FONT face="Courier New" color=#1a1a70 size=3></FONT>&nbsp;</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-&gt;GetPointData()-&gt;SetScalars(array) ;</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData-&gt;SetDimensions(size) ;</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData-&gt;SetScalarType(VTK_UNSIGNED_CHAR) ;</P></FONT><FONT face=Wingdings2 color=#3167d4>
<P align=left></FONT><FONT face="Courier New" color=#1a1a70>imageData-&gt;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-&gt;SetOrigin(0.0, 0.0, 0.0 );</FONT></P></FONT></FONT></FONT>
&nbsp;<BR>
&gt; Date: Sat, 22 Dec 2007 02:47:47 -0800<BR>&gt; From: subhas_vtk@yahoo.com<BR>&gt; To: vtkusers@vtk.org<BR>&gt; Subject: [vtkusers] Store a BMP image in a uchar array<BR>&gt; <BR>&gt; Hi<BR>&gt; I am a novice to VTK. I am able to read a VTK<BR>&gt; File and able to display through imageActor. May I<BR>&gt; know how to store the bmp image content in a uchar<BR>&gt; array.<BR>&gt; Please find below my code. <BR>&gt; <BR>&gt; Regards<BR>&gt; Subhas <BR>&gt; <BR>&gt; vtkBMPReader *bmpReader = vtkBMPReader::New();<BR>&gt; bmpReader-&gt;SetFileName("/home/subhas/software/VTK/MyExamples/masonry.bmp");<BR>&gt; bmpReader-&gt;Update();<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; vtkImageActor *imageActor = vtkImageActor::New();<BR>&gt; imageActor-&gt;SetInput( bmpReader-&gt;GetOutput() );<BR>&gt; <BR>&gt; <BR>&gt; vtkImageData *imageData = imageActor-&gt;GetInput();<BR>&gt; <BR>&gt; vtkUnsignedCharArray <BR>&gt; *array = vtkUnsignedCharArray::New();<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; ____________________________________________________________________________________<BR>&gt; Looking for last minute shopping deals? <BR>&gt; Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list. <BR>&gt; Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; 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>