<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#0b5394">Hi Fabian,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#0b5394"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#0b5394">Are you looking for window width / level adjustment or camera adjustment?</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#0b5394"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#0b5394">The keypress callback for 'r' key resets the camera position and focal point. Since, you've already tried calling ResetCamera() in the callback, I would make sure that you are calling ResetCamera on the correct Renderer. You'd also have to call RenderWindow::Render() after that.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#0b5394"><br></div><div class="gmail_extra"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Hope this helps!</div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif"><b><font size="2">Sankhesh Jhaveri</font></b><br><i>Sr. Research & Development Engineer</i> | </span></span><span style="font-family:verdana,sans-serif;color:rgb(11,83,148)"><a href="http://www.kitware.com" target="_blank">Kitware</a> | </span><span style="font-family:verdana,sans-serif;color:rgb(11,83,148)">(518) 881-4417</span><div><br><b></b><br> </div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Oct 10, 2016 at 5:24 PM, Fabian Torres <span dir="ltr"><<a href="mailto:fabian.trobles@gmail.com" target="_blank">fabian.trobles@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Hi all.
I have a slice of a volume displayed on a vtkImageViewer2. </pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)">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:</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif">if (reset){</span><br></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><pre style="white-space:pre-wrap"> viewerSagital->GetRenderer()-><wbr>ResetCamera();
viewerSagital->Render();
}</pre><pre style="white-space:pre-wrap"><span style="font-family:arial,sans-serif">but this does not do anything to the viewer. </span></pre><pre style="white-space:pre-wrap"><span style="font-family:arial,sans-serif">The interactorstyle code is as follows:</span><br></pre>
case 'r' :
case 'R' :
this->FindPokedRenderer(rwi-><wbr>GetEventPosition()[0],
rwi->GetEventPosition()[1]);
if(this->CurrentRenderer!=0)
{
this->CurrentRenderer-><wbr>ResetCamera();
}
else
{
vtkWarningMacro(<<"no current renderer on the interactor style.");
}
rwi->Render();
break;
<br></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><pre style="white-space:pre-wrap"><span style="font-family:arial,sans-serif">Someone could help me?</span></pre>Thanks</pre><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div>Fabián Torres Robles<br>Maestria en Ciencias en Ingeniería Electrónica<br>Ingeniería en Sistemas Electrónicos<br>tel. 58081280, 0445534661338<br>e-mail <a href="mailto:fabian.trobles@gmail.com" target="_blank">fabian.trobles@gmail.com</a>, <a href="mailto:dae.wong@gmail.com" target="_blank">dae.wong@gmail.com</a> <div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div>