[vtkusers] How to make vtkImageViewer2 to show an actor only in a certain depth

Sam Raby rabysam28 at gmail.com
Thu Jun 19 21:19:22 EDT 2014


Thanks for the guides. I implemented it using the vtkCutter and it works
fast and smooth.

-S


On Mon, Jun 16, 2014 at 1:46 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> I'd like to second this: a cutter is the right way to go.  Clipping planes
> are
> the wrong way to go.  When you use clipping planes, the result depends on
> the angle of your sphere polygons with respect to the camera, so the
> resulting
> "circle" will have some line segments that look too thick, and some other
> line
> segments that are so thin that they become invisible.
>
> I've used vtkCutter for this and it is plenty fast enough.  In fact I've
> even
> run the cutter's output through vtkTubeFilter to make the cut outlines look
> thicker, and it was still fast enough even with that extra step.
>
>   David
>
>
> On Mon, Jun 16, 2014 at 12:27 PM, Miro Drahos <mdrahos at robodoc.com> wrote:
> > Hi Sam,
> > if your surface is not too large, it shouldn't hinder the performance
> much.
> > I cut a polydata with ~20k vertices interactively, by sliding the cut
> plane
> > and there are no issues (on a lower-end NVIDIA GPU).
> >
> > To answer your question: there is another way -- you could use clipping
> > range of the camera and let the camera frustum cut your surface, but I
> would
> > advise against this hack. Just stick with the vtkCutter. It uses a point
> > locator (sort of a hash-table) to speed up the lookup and really
> shouldn't
> > give you much of performance penalty.
> >
> >
> >
> >
> >
> > On 06/16/2014 10:43 AM, Sam Raby wrote:
> >
> > Thanks for the feedback.
> > Consider a scenario that you have a slider-bar which scroll through DICOM
> > files and then this "clipping" has to happen for each slice repeatedly.
> I am
> > afraid that this would not allow the slider-bar to smoothly move, but
> maybe
> > there no faster way presently.
> >
> > Is there a way to hide only a part of an actor, and not the entire actor
> > (instead of cutting it)?
> >
> > -Sam
> >
> >
> > On Mon, Jun 16, 2014 at 12:21 PM, Miro Drahos <mdrahos at robodoc.com>
> wrote:
> >>
> >> If what you want is to cut your sphere and visualize the intersection of
> >> the sphere (a circle) with the viewer plane, use vtkCutter.
> >> The sphere polydata is the input, the reslice plane is the cutFunction.
> >> HTH,
> >> Miro
> >>
> >>
> >>
> >> On 06/13/2014 02:34 PM, Sam Raby wrote:
> >>>
> >>> Hello,
> >>>
> >>> I have a simple actor as simple as sphere and would like to show it in
> a
> >>> certain depth in vtkImageViewer2.
> >>>
> >>> vtkImageViewer2 displays all the actors which are above the image, but
> is
> >>> there a way to force vtkImageViewer2 to show only that part of sphere
> actor
> >>> that is in the same depth as the image?
> >>>
> >>> I saw a post [1] stating that the following may do the job, but I could
> >>> not make it work:
> >>>
> >>> interactorStyle->AutoAdjustCameraClippingRangeOff().
> >>>
> >>> thanks,
> >>> -sam
> >>>
> >>> [1] http://www.vtk.org/pipermail/vtkusers/2008-August/047565.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140619/a0f1def3/attachment.html>


More information about the vtkusers mailing list