<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>I think you are making this too difficult for yourself.  If you only want to show 3 ortho planes,<br></div>one in each render window, I would recommend using vtkImageSlice, set up its mapper with <br></div>vtkImageSliceMapper and manipulate window/level with the vtkImageSlice's vtkImageProperty object.<br><br></div><div>here is how you might set this up in pseudocode<br></div><br>vtkImageReader reader<br></div>reader SetFileName( my_3D_image_file )<br><br></div></div>vtkImageSliceMapper mapperX<br></div>mapperX SetInputData( reader GetOutput() )<br></div><div>mapperX SetOrientationToX()<br></div><div>mapperX Update()<br><br></div>vtkImageSlice sliceX<br>sliceX SetMapper( mapperX )<br><br></div><div>vtkRenderer rendererX<br></div><div>rendererX AddActor( sliceX )<br><br></div>QVTKWidget widgetX<br></div>vtkRenderWindow winX = widgetX GetRenderWindow()<br></div>winX AddRenderer( rendererX )<br><br></div>do the same for Y and Z, setting each mapper to the same<br></div>reader output.  Your Qt interface will need to have frames or some other Qt<br>container for each QVTKWidget.  You could put a Qt QSlider for controlling each<br></div>widget's vtkImageSliceMapper and use slots and signals to update<br></div>the mapper's SetSliceNumber() method with the value of the slider.<br><div><br></div><div>- Dean<br></div><div><br><div><div><div><br><br><div><div><div><div><div><div><div><br><br><br></div></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 7, 2015 at 9:28 PM, LaChen <span dir="ltr"><<a href="mailto:sam24666806@gmail.com" target="_blank">sam24666806@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">DL I wrote<br>
<span class="">> Hi LaChen<br>
><br>
> can you explain why you want to do this (what is the user interface<br>
> supposed to present) ?<br>
> Are you trying to map the texture onto some other surface or  are you<br>
> trying to show the sliced image as a 2D<br>
> image in a renderer ?<br>
><br>
> regards,<br>
> Dean<br>
><br>
</span>> On Wed, Oct 7, 2015 at 6:04 AM, LaChen &lt;<br>
<br>
> sam24666806@<br>
<div><div class="h5"><br>
> &gt; wrote:<br>
><br>
>> Hi, I try to use vtkImagePanelWidget::GetTexture() to get texture of<br>
>> slicing<br>
>> by indicated index (SetSliceIndex).<br>
>><br>
>> After I get texture, I downcast the texture to OpenGLTexture to get<br>
>> vtkTextureObject.<br>
>><br>
>> Then I try to the the handle of the texture object. Finally, I write some<br>
>> codes to draw an rectangle and texture by the handle. But it seems not<br>
>> work.<br>
>><br>
>> Is my way correctly??<br>
>><br>
>> If it's not correct, how to show one slice in a plane.<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://vtk.1045678.n5.nabble.com/vtkImagePanelWidget-Offscreen-Renderer-tp5734298.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/vtkImagePanelWidget-Offscreen-Renderer-tp5734298.html</a><br>
>> Sent from the VTK - Users mailing list archive at Nabble.com.<br>
>> _______________________________________________<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<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_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=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/mailman/listinfo/vtkusers</a><br>
>><br>
><br>
> _______________________________________________<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<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_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=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/mailman/listinfo/vtkusers</a><br>
<br>
</div></div>Hi, thank for your reply.<br>
<br>
The reason I want to do is that I need to show slicing image of three<br>
axes(x,y,z) and I can select index which slicing image I want to show. Then<br>
I find an good example (QtVTKRenderWindows). I learn vtkImagePanelWidget in<br>
the example. So I use QT and create three QVTKWidgets. And I try to binding<br>
vtkImagePanelWidget for each. But I encounter some problem. First, I try to<br>
blocking all mouse event.<br>
I inherit CameraInteractorStyle and block event left button press. But I<br>
fail. Second, I set eye position of active camera, It seems no use. So I try<br>
to use OpenGL to draw an rectangle and find texture of slicing image from<br>
vtkImagePanelWidget.<br>
<br>
Above-mentioned is the flow I try to handle my problem. Can you share your<br>
experience about my problem? I can't understand what component I should use.<br>
Is VTKSlidingImage or vtkImagePanelWidget.<br>
And I don't know how to set up interactor of offscreen rendering.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtkImagePanelWidget-Offscreen-Renderer-tp5734298p5734313.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/vtkImagePanelWidget-Offscreen-Renderer-tp5734298p5734313.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<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/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_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=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/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>