[vtkusers] updating vtkWindowLevelLookupTable parameters on the fly

jeremiah newbie jeremiahnewbie at delusional.nu
Mon Mar 18 11:56:41 EST 2002


I am trying to build a scalar cut plane visualiation tool in 
python, similar to the one seen in mayavi.  However unlike mayavi, 
I want to be able to adjust the window and level used to visualize 
the data.

To do this I am trying to update the "window" and "level" 
parameters of my vtkWindowLevelLookupTable.  I've set up a simple 
gui that uses Entry fields to gather the new values.  once the new 
values are entered I call this function (via a bind):

   def change_window_and_level(self, event=None):
        self.window = self.window_var.get ()
        self.lut.SetWindow (self.window)
        self.level = self.level_var.get ()
        self.lut.SetLevel (self.level)
        self.lut.Build ()
        self.map.SetLookupTable (self.lut)
        self.map.Update ()
        self.act.SetMapper (self.map)

where "self.map" is a vtkPolyDataMapper defined 
previously.  "self.window_var" and "self.level_var" were defined 
as "Tkinter.DoubleVar" and were given as the "textvar" parameter 
for my Entry fieldsUnfortunately when I try this, no changes to 
the scalar cut plane occur at all.  If I close the widget window 
where my Entry fields are, then open the widget window again I can 
see that the new updated values are present in the Entry 
fields ... so I guess that means the values -are- saving.  There 
are just no updates to the scalar cut plane.

I can't see what I'm doing wrong, could someone point me in the 
right direction?  Thanks in advance

Jeremy
  

 

________________________________________________________________
Sent via the KillerWebMail system at delusional.nu


 
                   



More information about the vtkusers mailing list