The W/L LUT mapping is not and was never handled in QVTKWidget or in vtkInteractorStyleImage.<br><br>vtkInteractorStyleImage simply provides the events. Its up to you to respond to the WindowLevelEvent and hook your own vtkImageMapToColors to do the LUT mapping. <br>
<br>See how the class vtkImageViewer2 does it.<br><br><div class="gmail_quote">On Thu, Feb 17, 2011 at 3:46 PM, Jothy <span dir="ltr">&lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the help<br>
<br>
But it still doesn&#39;t work, hese is my code<br>
<div class="im"><br>
this-&gt;axialRenderer -&gt;AddActor(slicer.axialSlice);<br>
</div> vtkInteractorStyleImage *style = vtkInteractorStyleImage::New();<br>
<div class="im"> this-&gt;ui-&gt;AxialWidget-&gt;GetRenderWindow()-&gt;AddRenderer(this-&gt;axialRenderer);<br>
 this-&gt;ui-&gt;AxialWidget-&gt;GetRenderWindow()-&gt;Render();<br>
</div>  this-&gt;ui-&gt;AxialWidget-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;SetInteractorStyle(style);<br>
<br>
Is it necessary to add observer, if I wnat to use the default<br>
functionality of the interactor?<br>
<br>
I think it has something with the classing, QtWidgets has this problem with vtk.<br>
<br>
Thanks<br>
<br>
Jothy<br>
<br>
<br>
<br>
On Wed, Feb 16, 2011 at 8:42 PM,  &lt;<a href="mailto:lindeval@dmat.ufrr.br">lindeval@dmat.ufrr.br</a>&gt; wrote:<br>
&gt; Hi!!<br>
&gt;<br>
&gt; See in my code below how to use vtkInteractorStyleImage with QVTKWidget.<br>
&gt;<br>
&gt;<br>
&gt;    fant-&gt;sliceTransversalRen-&gt;AddActor(fant-&gt;sliceTransversalActor);<br>
&gt;    fant-&gt;sliceTransversalRen-&gt;SetBackground(1.0,1.0,1.0);<br>
&gt;<br>
&gt;    vtkInteractorStyleImage *style = vtkInteractorStyleImage::New();<br>
&gt;    ui-&gt;qvtkWidgetTrans-&gt;GetRenderWindow()-&gt;AddRenderer(fant-&gt;sliceTransversalRen);<br>
&gt;    ui-&gt;qvtkWidgetTrans-&gt;GetRenderWindow()-&gt;Render();<br>
&gt;    //ui-&gt;qvtkWidgetTrans-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;AddObserver(vtkCommand::LeftButtonPressEvent,fant-&gt;mcb,1.0);<br>
&gt;    ui-&gt;qvtkWidgetTrans-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;SetInteractorStyle(style);<br>
&gt;<br>
&gt;<br>
&gt; ----- Mensagem original -----<br>
&gt; De: &quot;Jothy&quot; &lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt;<br>
&gt; Para: &quot;VTK Mailing List&quot; &lt;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;<br>
&gt; Enviadas: Quarta-feira, 16 de Fevereiro de 2011 8:19:04 (GMT-0300) Auto-Detected<br>
&gt; Assunto: [vtkusers] QVTKWidget with interactorStyleImage does not work<br>
<div><div></div><div class="h5">&gt;<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I am trying to set the interactor style to image ina QVTKWidget.I am<br>
&gt; setting it by calling the interactor by<br>
&gt; QVTKWidget-&gt;GetInteractor()-&gt;SetInteractorStyle().<br>
&gt;<br>
&gt; But it doesn&#39;t work. The image doesn&#39;t rotate as expected for a 2D<br>
&gt; image interactor, but the W/L and W/W don&#39;t change on mouse move!<br>
&gt;<br>
&gt; Here is the bit of that code<br>
&gt;<br>
&gt; this-&gt;axialRenderer -&gt;AddActor(slicer.axialSlice);<br>
&gt;  this-&gt;ui-&gt;AxialWidget-&gt;GetInteractor()-&gt;SetInteractorStyle(this-&gt;imageInteractorStyle);<br>
&gt;  this-&gt;ui-&gt;AxialWidget-&gt;GetRenderWindow()-&gt;AddRenderer(this-&gt;axialRenderer);<br>
&gt;  this-&gt;ui-&gt;AxialWidget-&gt;GetRenderWindow()-&gt;Render();<br>
&gt; //this-&gt;ui-&gt;AxialWidget-&gt;show();<br>
&gt;<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Jothy<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>