[vtkusers] vtkImagePlaneWidget + SetTextureVisibility()

Mark Wyszomierski markww at gmail.com
Fri Apr 13 09:17:07 EDT 2007


Dean,

Calling Update() seems to fix it Thanks for the help,

Mark

On 4/13/07, dean.inglis at camris.ca <dean.inglis at camris.ca> wrote:
> Mark,
>
> what happens if you do this ?:
>
> pImageData = pPlaneWidget->GetResliceOutput();
> pImageData->Update();
>
> or if you need the texture:
>
> pTexture = pPlaneWidget->GetTexture();
> pTexture->Update();
>
>
>
> Dean
>
> > Subject: Re: [vtkusers] vtkImagePlaneWidget + SetTextureVisibility()
> >
> > Hi Dean,
> >
> > I think I'm already doing what you described.I have an observer like:
> >
> >     m_vPlane->AddObserver(vtkCommand::InteractionEvent, m_vPlaneCallback);
> >
> > and it does get called when I started dragging the plane with the
> > mouse. All that happens afterwards is that I call:
> >
> >     pImageData = pPlaneWidget->GetResliceOutput();
> >
> > It is getting called everytime I interact.
> >
> > I don't understand how if I initially turn the Texture visibility off
> > - then I get correct output like 80% of the time (the other 20% the
> > resulting extent comes back as (0,0,0). If I switch it on (visible)
> > just one time - it seems I always get correct output. I'm only
> > switching it on once, not toggling it on/off everytime I need resliced
> > output. It seems like maybe turning it on just once sets up some
> > pipeline internally maybe?
> >
> > I'm confused! I don't know the internals of the class. Thanks for any
> > more information you may have, it is an extremely useful class,
> >
> > Thanks,
> > Mark
> >
> >
> > On 4/12/07, dean.inglis at camris.ca <dean.inglis at camris.ca> wrote:
> > > Mark,
> > >
> > > there are numerous ways to get at the resliced output:
> > >  // Description:
> > >  // Convenience method to get the vtkImageReslice output.
> > >  vtkImageData* GetResliceOutput();
> > >
> > > which in vtkIPW is passed to vtkImageMapToColors
> > > whose output is passed to vtkTexture.  vtkIPW
> > > can give you the vtkImageMapToColors and/or the vtkTexture too.
> > > If you write a callback and add it to the widgets
> > > InteractionEvent wherein the texture can be requested to
> > > Update(), then you can avoid switching texture on and
> > > off:
> > > e.g., widget->AddObserver(vtkCommand::InteractionEvent, myCallback).
> > > If you are using a GUI element to move the widget,
> > > you can still force the update by:
> > > widget->InvokeEvent(vtkCommand::InteractionEvent).
> > >
> > > Normally, when the actor that combines the vtkPlaneSource
> > > and the vtkTexture is visible, the rendering pipeline mechanism
> > > takes care of updating the texture (and preceding filters) for you.
> > > When texture visibility is off, there is no visible actor
> > > (maybe just the outline) and so the widget's internal
> > > pipeline is not being updated.
> > >
> > > Dean
> > > _______________________________________________
> > > 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
> > >
> >
>



More information about the vtkusers mailing list