[vtkusers] Initial zooming of QVTKWidget
Erik Tuerke
tuerke at cbs.mpg.de
Thu Nov 4 12:18:40 EDT 2010
Hi!
Thanks so far for all your help with the QVTKWidget.
My problem now is a wrong initial zooming factor. Unless i click on the
widget, the image is a little bit too small.
Here is my pipeline so far:
QVTKWidget *m_AxialWidget;
m_Image = vtkImageData::New();
m_ActorAxial = vtkActor::New();
m_MapperAxial = vtkDataSetMapper::New();
m_ExtractAxial = vtkImageClip::New();
m_RendererAxial = vtkRenderer::New();
m_InteractionStyleAxial = new ViewerInteractor(this, m_RendererAxial);
m_AxialWidget->GetInteractor()->SetInteractorStyle(
m_InteractionStyleAxial );
m_AxialWidget->GetRenderWindow()->SetInteractor(
m_AxialWidget->GetInteractor() );
m_ExtractAxial->SetInput( m_Image );
(..) //configuring m_ExtractAxial
m_ExtractAxial->Update();
m_MapperAxial->SetInput( m_ExtractAxial->GetOutput() );
m_ActorAxial->SetMapper( m_MapperAxial );
m_RendererAxial->AddActor( m_ActorAxial );
m_AxialWidget->GetInteractor()->Initialize();
m_RendererAxial->ResetCamera();
m_AxialWidget->update();
I have to admit that i am a little confused regarding the
m_AxialWidget->GetInteractor() and
m_AxialWidget->GetRenderWindow()->GetInteractor(). But i tried both methods.
As mentioned after this pipeline the image is shown in the widget but
unfortunately with what appears to be a wrong zooming factor (image is a
little too small).
If i now click on the widget the zooming changes to normal. But the
weird thing is that the only methods which are called after clicking on
the widget are:
vtkCellPicker::Pick(...)
vtkCellPicker::GetMapperPosition()
//configuring m_ExtractAxial
m_ExtractAxial->Update();
m_AxialWidget->update();
m_RendererAxial->ResetCamera();
Does anybody know this problem and can give me a hint?
Thanks in advance!
--
Erik Tuerke
Department of Neurophysics
Max-Planck-Institute for Human Cognitive and Brain Sciences
Stephanstrasse 1A
04103 Leipzig
Germany
Tel: +49 341 99 40-2440
Email: tuerke at cbs.mpg.de
www.cbs.mpg.de
More information about the vtkusers
mailing list