Hi Rafael,<br><br>I think you're missing a lookup table. Your mapper needs a lookuptable to see what scalar is translated into which color.<br><br>I suggest creating a lookuptable and adding the lookuptable to the mapper.
<br><br>lookupTable = vtk.vtkLookupTable()<br>lookupTable.SetNumberOfColors(numberofscalars)<br>lookupTable.SetTableRange(0,1)<br>lookupTable.ForceBuild()<br><br>conjuto..SetLookupTable(lookupTable)<br><br>You'll probably need to take a closer look at lookup tables as i use a discrete number of colors (hence the SetNumberOfColors), no idea what kind of table you need.
<br><br>Regards - Geoframer<br><br><div><span class="gmail_quote"><br><br>On 9/6/07, <b class="gmail_sendername">rafael possani</b> <<a href="mailto:gentefinabr@hotmail.com">gentefinabr@hotmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="text-align: left;"><br> Hi vtk-users, I am with a problem. I am reading xy point into a vtkStructuredPoints and I would like to save like a image, but I cant... my vtkRenderWindow shows ok, but my image dont have colors and I know why, I need to set the scalars range into the vtkStructuredPoints but I dont know what method to use, that a part of my code:
<br><br>vtkStructuredPoints points = new vtkStructuredPoints();<br> points.SetDimensions( 128, 73, 1);<br> points.SetOrigin( 0.0, 0.0, 0.0 );<br> points.SetSpacing( 1.0, 1.0, 1.0 );<br> points.SetScalarTypeToUnsignedChar
();<br> points.SetNumberOfScalarComponents(id);<br> points.GetPointData().SetScalars( scalars ); // <--- Doesn´t work :/ with that my image only be red <br><br>the scalars vector are double in Scientific notation I dont know if its bad.
<br><br>I have been trying all possible methods but I hadn´t success.<br><br>my mapper renders ok:<br><br>vtkDataSetMapper conjunto = new vtkDataSetMapper();<br> conjunto.SetInput(points);<br> conjunto.SetScalarRange
(points.GetScalarRange()); <---- But it works here<br><br>I´m thinking that a need a method like SetScalarRange from my mapper to use before in my vtkStructuredPoints.<br><br>besides, I am using vtkImageMapToColors to convert my structured points into a image. I also can post my entire code, but I made the same like this link, without the beginning because I generated my points :)
<a href="http://public.kitware.com/pipermail/vtkusers/2005-December/083147.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://public.kitware.com/pipermail/vtkusers/2005-December/083147.html
</a><br><br><br>Well, someone suggest me a method for my vtkStructuredPoints? thanks in advanced.<br><span class="ad"><br><br></span></div><span class="ad"><br><hr>Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile!
<a href="http://mobile.live.com/signup/signup2.aspx?lc=pt-br" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Cadastre-se já!</a></span></div><span class="ad">
</span><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br></blockquote></div><br>