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"><<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>></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't work, hese is my code<br>
<div class="im"><br>
this->axialRenderer ->AddActor(slicer.axialSlice);<br>
</div> vtkInteractorStyleImage *style = vtkInteractorStyleImage::New();<br>
<div class="im"> this->ui->AxialWidget->GetRenderWindow()->AddRenderer(this->axialRenderer);<br>
this->ui->AxialWidget->GetRenderWindow()->Render();<br>
</div> this->ui->AxialWidget->GetRenderWindow()->GetInteractor()->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, <<a href="mailto:lindeval@dmat.ufrr.br">lindeval@dmat.ufrr.br</a>> wrote:<br>
> Hi!!<br>
><br>
> See in my code below how to use vtkInteractorStyleImage with QVTKWidget.<br>
><br>
><br>
> fant->sliceTransversalRen->AddActor(fant->sliceTransversalActor);<br>
> fant->sliceTransversalRen->SetBackground(1.0,1.0,1.0);<br>
><br>
> vtkInteractorStyleImage *style = vtkInteractorStyleImage::New();<br>
> ui->qvtkWidgetTrans->GetRenderWindow()->AddRenderer(fant->sliceTransversalRen);<br>
> ui->qvtkWidgetTrans->GetRenderWindow()->Render();<br>
> //ui->qvtkWidgetTrans->GetRenderWindow()->GetInteractor()->AddObserver(vtkCommand::LeftButtonPressEvent,fant->mcb,1.0);<br>
> ui->qvtkWidgetTrans->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);<br>
><br>
><br>
> ----- Mensagem original -----<br>
> De: "Jothy" <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>><br>
> Para: "VTK Mailing List" <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
> Enviadas: Quarta-feira, 16 de Fevereiro de 2011 8:19:04 (GMT-0300) Auto-Detected<br>
> Assunto: [vtkusers] QVTKWidget with interactorStyleImage does not work<br>
<div><div></div><div class="h5">><br>
> Hi all,<br>
><br>
> I am trying to set the interactor style to image ina QVTKWidget.I am<br>
> setting it by calling the interactor by<br>
> QVTKWidget->GetInteractor()->SetInteractorStyle().<br>
><br>
> But it doesn't work. The image doesn't rotate as expected for a 2D<br>
> image interactor, but the W/L and W/W don't change on mouse move!<br>
><br>
> Here is the bit of that code<br>
><br>
> this->axialRenderer ->AddActor(slicer.axialSlice);<br>
> this->ui->AxialWidget->GetInteractor()->SetInteractorStyle(this->imageInteractorStyle);<br>
> this->ui->AxialWidget->GetRenderWindow()->AddRenderer(this->axialRenderer);<br>
> this->ui->AxialWidget->GetRenderWindow()->Render();<br>
> //this->ui->AxialWidget->show();<br>
><br>
><br>
> Thanks<br>
><br>
> Jothy<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>
><br>
><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>