[vtkusers] slice a volume

David Gobbi david.gobbi at gmail.com
Fri Feb 12 13:37:43 EST 2016


I know that VTK has classes for exporting a scene, but I'm not very
familiar with them.  Search for "VTK" and "Exporter" to see what exporters
exist.  You want to export the entire scene from the renderer to a file,
and then import the file as a single vtkPolyData object.

 - David


On Fri, Feb 12, 2016 at 11:26 AM, WangQ <wangq1979 at outlook.com> wrote:

> Good tips, indeed.
>
> Any example or particular class for the purpose?
>
> Cheers,
>
> Chiang
>
> ------------------------------
> From: david.gobbi at gmail.com
> Date: Fri, 12 Feb 2016 11:02:07 -0700
>
> Subject: Re: [vtkusers] slice a volume
> To: wangq1979 at outlook.com
> CC: vtkusers at vtk.org
>
> No, that really isn't possible.  In any case, it would be far easier and
> far, far more efficient to export the scene as a single polygonal object
> (using point attributes for colors and whatnot) and then apply vtkCutter to
> it.
>
>  - David
>
>
> On Fri, Feb 12, 2016 at 10:48 AM, WangQ <wangq1979 at outlook.com> wrote:
>
> Thanks David,
>
> Sounds like meta-meta programming.
>
> Is it possible to save the data of the image like a sequence of slices,
> and then load as an image data for cutting?
>
> Cheers,
>
> Chiang
>
> ------------------------------
> From: david.gobbi at gmail.com
> Date: Fri, 12 Feb 2016 10:25:21 -0700
> Subject: Re: [vtkusers] slice a volume
> To: wangq1979 at outlook.com
> CC: vtkusers at vtk.org
>
>
> Hi Chiang,
>
> It sounds like you need something that will select some or all of the
> actors in the scene, trace backwards through the pipeline to get the data,
> apply a cutter to the data, and then create new mappers and actors to show
> the cut.  This is possible, but not easy!
>
> Another approach is to create an additional layer of abstraction on top of
> VTK to manage situations like this.  For example, you could create a
> "SuperActor" class to manage the extra filters, mappers, and actors that
> are needed to display the cut.  Then, if you give a cutting plane to the
> "SuperActor", it can automatically add the vtkCutter, a new mapper, and a
> new actor to the renderer.  And a "SuperSuperActor" could be used to manage
> multiple "SuperActors".  All of this requires a lot of programming, however.
>
> In summary: I don't think there is an easy solution.  Hopefully someone
> will prove me wrong!
>
>  - David
>
>
> On Fri, Feb 12, 2016 at 9:55 AM, WangQ <wangq1979 at outlook.com> wrote:
>
> Hello,
>
> Thanks for the prompt response.
>
> However, the point is that the shown volume is not from single input. The
> spheres inside the cylinder are generated dynamically, and included in the
> vtkRender one by one, i.e. each sphere has its own mapper, actor, etc.
> Therefore, simply using cutter or plane is unable to fulfill the slicing.
>
> One thing I can imagine is that if I can get the data from the renderer, I
> can then apply cutter or plane to slice it. But I do not know how to get
> the data.
>
> Cheers,
>
> Chiang
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160212/75a03d37/attachment.html>


More information about the vtkusers mailing list