[vtkusers] vtkImagePanelWidget Offscreen Renderer

DL I inglis.dl at gmail.com
Thu Oct 8 09:41:17 EDT 2015


I think you are making this too difficult for yourself.  If you only want
to show 3 ortho planes,
one in each render window, I would recommend using vtkImageSlice, set up
its mapper with
vtkImageSliceMapper and manipulate window/level with the vtkImageSlice's
vtkImageProperty object.

here is how you might set this up in pseudocode

vtkImageReader reader
reader SetFileName( my_3D_image_file )

vtkImageSliceMapper mapperX
mapperX SetInputData( reader GetOutput() )
mapperX SetOrientationToX()
mapperX Update()

vtkImageSlice sliceX
sliceX SetMapper( mapperX )

vtkRenderer rendererX
rendererX AddActor( sliceX )

QVTKWidget widgetX
vtkRenderWindow winX = widgetX GetRenderWindow()
winX AddRenderer( rendererX )

do the same for Y and Z, setting each mapper to the same
reader output.  Your Qt interface will need to have frames or some other Qt
container for each QVTKWidget.  You could put a Qt QSlider for controlling
each
widget's vtkImageSliceMapper and use slots and signals to update
the mapper's SetSliceNumber() method with the value of the slider.

- Dean







On Wed, Oct 7, 2015 at 9:28 PM, LaChen <sam24666806 at gmail.com> wrote:

> DL I wrote
> > Hi LaChen
> >
> > can you explain why you want to do this (what is the user interface
> > supposed to present) ?
> > Are you trying to map the texture onto some other surface or  are you
> > trying to show the sliced image as a 2D
> > image in a renderer ?
> >
> > regards,
> > Dean
> >
> > On Wed, Oct 7, 2015 at 6:04 AM, LaChen <
>
> > sam24666806@
>
> > > wrote:
> >
> >> Hi, I try to use vtkImagePanelWidget::GetTexture() to get texture of
> >> slicing
> >> by indicated index (SetSliceIndex).
> >>
> >> After I get texture, I downcast the texture to OpenGLTexture to get
> >> vtkTextureObject.
> >>
> >> Then I try to the the handle of the texture object. Finally, I write
> some
> >> codes to draw an rectangle and texture by the handle. But it seems not
> >> work.
> >>
> >> Is my way correctly??
> >>
> >> If it's not correct, how to show one slice in a plane.
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://vtk.1045678.n5.nabble.com/vtkImagePanelWidget-Offscreen-Renderer-tp5734298.html
> >> Sent from the VTK - Users mailing list archive at Nabble.com.
> >> _______________________________________________
> >> Powered by www.kitware.com
> >>
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >>
> >> Please keep messages on-topic and check the VTK FAQ at:
> >> http://www.vtk.org/Wiki/VTK_FAQ
> >>
> >> Search the list archives at: http://markmail.org/search/?q=vtkusers
> >>
> >> Follow this link to subscribe/unsubscribe:
> >> http://public.kitware.com/mailman/listinfo/vtkusers
> >>
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Search the list archives at: http://markmail.org/search/?q=vtkusers
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
>
> Hi, thank for your reply.
>
> The reason I want to do is that I need to show slicing image of three
> axes(x,y,z) and I can select index which slicing image I want to show. Then
> I find an good example (QtVTKRenderWindows). I learn vtkImagePanelWidget in
> the example. So I use QT and create three QVTKWidgets. And I try to binding
> vtkImagePanelWidget for each. But I encounter some problem. First, I try to
> blocking all mouse event.
> I inherit CameraInteractorStyle and block event left button press. But I
> fail. Second, I set eye position of active camera, It seems no use. So I
> try
> to use OpenGL to draw an rectangle and find texture of slicing image from
> vtkImagePanelWidget.
>
> Above-mentioned is the flow I try to handle my problem. Can you share your
> experience about my problem? I can't understand what component I should
> use.
> Is VTKSlidingImage or vtkImagePanelWidget.
> And I don't know how to set up interactor of offscreen rendering.
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/vtkImagePanelWidget-Offscreen-Renderer-tp5734298p5734313.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151008/11804b52/attachment.html>


More information about the vtkusers mailing list