[vtkusers] Reset Window Level with code

Fabian Torres fabian.trobles at gmail.com
Mon Oct 10 17:24:46 EDT 2016


Hi all.

I have a slice of a volume displayed on a vtkImageViewer2.

I understand that if I modified the window levels by pressing the
button 1 of the mouse, I could reset the levels by pressing the letter
'r'.
I'm trying to reset the window levels with a user interface button.
I have implemented something similar to the code found in the
interactorstyleImage class:

if (reset){

           viewerSagital->GetRenderer()->ResetCamera();
           viewerSagital->Render();
}

but this does not do anything to the viewer.

The interactorstyle code is as follows:

case 'r' : case 'R' : this->FindPokedRenderer(rwi->GetEventPosition()[0],
rwi->GetEventPosition()[1]); if(this->CurrentRenderer!=0) {
this->CurrentRenderer->ResetCamera(); } else { vtkWarningMacro(<<"no
current renderer on the interactor style."); } rwi->Render(); break;

Someone could help me?

Thanks


-- 
Fabián Torres Robles
Maestria en Ciencias en Ingeniería Electrónica
Ingeniería en Sistemas Electrónicos
tel. 58081280, 0445534661338
e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161010/91161a7a/attachment.html>


More information about the vtkusers mailing list