<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thanks David.<div><br></div><div>I will check it.</div><div><br></div><div>Cheers,</div><div><br></div><div>Chiang<br><div><br><div><hr id="stopSpelling">From: david.gobbi@gmail.com<br>Date: Fri, 12 Feb 2016 11:37:43 -0700<br>Subject: Re: [vtkusers] slice a volume<br>To: wangq1979@outlook.com<br>CC: vtkusers@vtk.org<br><br><div dir="ltr">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.<div><br></div><div> - David</div><div><br><div class="ecxgmail_extra"><br><div class="ecxgmail_quote">On Fri, Feb 12, 2016 at 11:26 AM, WangQ <span dir="ltr"><<a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Good tips, indeed.<div><br></div><div>Any example or particular class for the purpose?</div><div><br></div><div>Cheers,</div><div><br></div><div>Chiang<br><br><div><hr>From: <a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a><br>Date: Fri, 12 Feb 2016 11:02:07 -0700<div><div><br>Subject: Re: [vtkusers] slice a volume<br>To: <a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a><br>CC: <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br><br><div dir="ltr">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.<div><br></div><div> - David</div><div><br><div><br><div>On Fri, Feb 12, 2016 at 10:48 AM, WangQ <span dir="ltr"><<a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Thanks David,<div><br></div><div>Sounds like meta-meta programming. </div><div><br></div><div>Is it possible to save the data of the image like a sequence of slices, and then load as an image data for cutting?</div><div><br></div><div>Cheers,</div><div><br></div><div>Chiang<br><br><div><hr>From: <a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a><br>Date: Fri, 12 Feb 2016 10:25:21 -0700<span><br>Subject: Re: [vtkusers] slice a volume<br></span>To: <a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a><br>CC: <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><div><div><br><br><div dir="ltr"><div>Hi Chiang,</div><div><br></div><div>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!</div><div><br></div><div>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.</div><div><br></div><div>In summary: I don't think there is an easy solution. Hopefully someone will prove me wrong!</div><div><br></div><div> - David</div><br><div><br><div>On Fri, Feb 12, 2016 at 9:55 AM, WangQ <span dir="ltr"><<a href="mailto:wangq1979@outlook.com" target="_blank">wangq1979@outlook.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Hello,<div><br></div><div>Thanks for the prompt response.</div><div><br></div><div>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. </div><div><br></div><div>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. </div><div><br></div><div>Cheers,</div><div><br></div><div>Chiang<br><div><div><div><div><div><blockquote style="border-left:1px #ccc solid;padding-left:1ex;"><div><div dir="ltr"><div><div><div dir="ltr"><div><br></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></div> </div></div>
</blockquote></div></div></div></div></div></div></div></div></div></div></blockquote></div><br></div></div></div></div></div></div> </div></body>
</html>