[vtkusers] Looking for the perfect scalarRange...

rafael possani gentefinabr at hotmail.com
Wed Sep 5 18:41:47 EDT 2007


   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:

vtkStructuredPoints points = new vtkStructuredPoints();
    points.SetDimensions( 128, 73, 1);
    points.SetOrigin( 0.0, 0.0, 0.0 );
    points.SetSpacing( 1.0, 1.0, 1.0 );
    points.SetScalarTypeToUnsignedChar();
    points.SetNumberOfScalarComponents(id);
    points.GetPointData().SetScalars( scalars );  // <--- Doesn´t work :/  with that my image only be red 

the scalars vector are double in Scientific notation I dont know if its bad.

I have been trying all possible methods but I hadn´t success.

my mapper renders ok:

vtkDataSetMapper conjunto = new vtkDataSetMapper();
    conjunto.SetInput(points);
    conjunto.SetScalarRange(points.GetScalarRange());  <---- But it works here

I´m thinking that a need a method like SetScalarRange from my mapper to use before in my vtkStructuredPoints.

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 :)  http://public.kitware.com/pipermail/vtkusers/2005-December/083147.html


Well, someone suggest me a method for my vtkStructuredPoints? thanks in advanced.



_________________________________________________________________
Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça  o MSN Mobile!
http://mobile.live.com/signup/signup2.aspx?lc=pt-br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070905/1d66fb05/attachment.htm>


More information about the vtkusers mailing list