Re: filling in a sphere's intersection with a plane
Andras Lasso <[email protected]> Fri, 11 Jan 2019 18:04:12 +0000
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <YTOPR0101MB1292D260585A087DE1F81B28D8850@YTOPR0101MB1292.CANPRD01.PROD.OUTLOOK.COM> |
In general, vtkCutter returns a random (unordered, non-continuous) list of line segments. Can vtkContourTriangulator deal with that (merge points and order line segments to form closed contours)? Usually we apply vtkStripper with a very large MaximumLength on vtkCutter output to create polygons that can be triangulated and rendered. This works well almost every time, but in some cases (cutting very complex geometries with hundreds of thousand of points) stripping does not find closed polygons. It would be nice to have a somewhat simpler and more robust solution. Andras From: vtkusers <[email protected]> On Behalf Of David Gobbi Sent: Friday, January 11, 2019 11:38 AM To: The Merper <[email protected]>; VTK Users <[email protected]> Subject: Re: [vtkusers] filling in a sphere's intersection with a plane If you already have the spheres as polydata, and if they are already in your volume coord system, then the simplest approach is probably to use these two filters: - vtkCutter, to cut the sphere (this generates a polyline contour of the intersection) - vtkContourTriangulator to fill the polyline contour with triangles When rendering the result on the image, the polydata and your image slice will be coincident in the z-buffer. It might be possible to fix this by calling SetResolveCoincidentTopologyToPolygonOffset() on the polydata mapper. Rendering the filled spheres with voxels would be more complicated. The vtkPolyDataToImageStencil class works volumetrically, i.e. it would be used to fill the entire sphere and produce a binary volume. Then the desired slice of that volume would be rendered as an overlay. David On Fri, Jan 11, 2019 at 8:02 AM The Merper <[email protected]<mailto:[email protected]>> wrote: Thanks for the speedy reply, David. The application is a GUI that allows users to mark points in a 3D MRI volume. The user browses the volume and marks the points in 2D slices of the volume, which are rendered via a vtkImageViewer2. Once a point is marked, I represent the location with a sphere. I use vtkSphereSource via vtkPolyDataMapper to render the spheres. I'd be happy using polygons or voxels. thanks again, -Merps On Thu, Jan 10, 2019 at 5:08 PM David Gobbi <[email protected]<mailto:[email protected]>> wrote: On Thu, Jan 10, 2019 at 12:13 PM The Merper <[email protected]<mailto:[email protected]>> wrote: I have a set of spheres in a volume that I visualize in 2D slices. When the plane of a 2D slice intersects a sphere, I want the interior of the sphere to be filled. How are the spheres defined? Do you already have them as vtkPolyData objects, or do you just have a list of "center and radius" values to describe the spheres? When you say "visualize in 2D slices" do you mean that you are already visualizing slices of something (e.g. of an image) and you want to display the sphere cuts as an overlay on the image? For your application, does it matter whether the sphere cuts are displayed as voxels (i.e. a vtkImageData) vs polygons? Also, for context, what is the general purpose of your application? Cheers, David _______________________________________________ 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: https://vtk.org/mailman/listinfo/vtkusers