[vtkusers] Looking for the perfect scalarRange...

Geoframer geoframer at gmail.com
Thu Sep 6 07:10:59 EDT 2007


Hi Rafael,

I think you're missing a lookup table. Your mapper needs a lookuptable to
see what scalar is translated into which color.

I suggest creating a lookuptable and adding the lookuptable to the mapper.

lookupTable = vtk.vtkLookupTable()
lookupTable.SetNumberOfColors(numberofscalars)
lookupTable.SetTableRange(0,1)
lookupTable.ForceBuild()

conjuto..SetLookupTable(lookupTable)

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.

Regards - Geoframer



On 9/6/07, rafael possani <gentefinabr at hotmail.com> wrote:
>
>
>    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! Cadastre-se já!<http://mobile.live.com/signup/signup2.aspx?lc=pt-br>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070906/99bfb866/attachment.htm>


More information about the vtkusers mailing list