[vtkusers] Looking for the perfect scalarRange...

rafael possani gentefinabr at hotmail.com
Thu Sep 6 10:05:21 EDT 2007


Hi Geoframer, first of all ,  thanks a lot for the reply, and well I have tested a lookuptable too, but without luck, I think that I mistaken some method, then I eraser my lookuptable and I writed another one like yours. And I still cant see the colors, only one cor, generally blue. Then I will post my program better to see if you may help me, one more time :)

I have 9344 points(values) into a vtkdoublearray, each one with a value in scientific notation(like around 20 kinds of combinations), for example, 3.5E-5, 1.0E-5, 1.0E-5 and 7.7E-6, my bigger number is 7.7E-6, and my lesser is 0.0, then I tried it in my lookuptable:

         lookupTable = vtk.vtkLookupTable()
        lookupTable .SetNumberOfColors(9344);
        lookupTable .SetTableRange(0,7.7E-6);
        lookupTable .ForceBuild();

After that I add into my mapper like y said:

     conjunto.SetLookupTable(lookupTable );
    And in my vtkImageMapToColors:

    oIMTC1 = vtk.vtkImageMapToColors();
    oIMTC1.SetLookupTable(lookupTable );

    But, as my mapper as my vtkImageViewer still be with just one color. Do you suggest some change? 
    Thanks, again.
    Rafael.

 
Date: Thu, 6 Sep 2007 13:10:59 +0200
From: geoframer at gmail.com
To: gentefinabr at hotmail.com
Subject: Re: [vtkusers] Looking for the perfect scalarRange...
CC: vtkusers at vtk.org

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á!

_______________________________________________
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





_________________________________________________________________
Receba GRÁTIS as últimas novidades do esporte direto no seu Messenger!
http://signup.alerts.live.com/alerts/login.do?PINID=37485679&returnURL=http://www.nivea.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070906/8ccb8eff/attachment.htm>


More information about the vtkusers mailing list