[vtkusers] Combining resliced images and polygons

Lars Friedrich Lars lars-friedrich at gmx.net
Fri Mar 26 02:15:58 EDT 2010


Hello Scott,

vtkClipPolyData does not really extract the contour, it clips the poly data with a specified (implicit) function. Clipping a sphere with a plane will produce a hemisphere. Depending on the method of visualization (see below) this could easily make troubles, especially if you set material properties (-> shadows hide parts ...).

You should rather use vtkCutter which is really capable of robustly extracting contours emerging from a cut with an implicit function. Depending on the method you're using to visualize the axial/coronal/sagittal views, it might be necessary to modify the plane function a bit to obtain a perfect non-floating visualization. For example the vtkImageViewer2 internally works by generating parallel projections of a 3D scene. Therefore it might be necessary to shift the plane a bit (really a bit - 0.001 or so which is diagnostically irrelevant) towards the camera position. You should also turn off all material props of that contour.

HTH,

lars


-------- Original-Nachricht --------
> Datum: Thu, 25 Mar 2010 17:14:38 -0500
> Von: "Scott Johnson" <Scott.Johnson at neuwave.com>
> An: vtkusers at vtk.org
> Betreff: [vtkusers] Combining resliced images and polygons

> Hi Folks,
> 
>  
> 
> I'm looking for a pointer.
> 
>  
> 
> I'm trying to display a resliced image, either axial, coronal, or
> sagital and then display a contour representing the same plane cutting
> through a polygonal shape.  In my current example I have created a
> sphere which intersects some of the image slices.  As I scroll through
> the slices I expect to see circles where the slice intersects the
> sphere.
> 
>  
> 
> Right now I have created a SphereSource -> ClipPolyData ->
> PolyDataMapper -> Actor.  The ClipPolyData has a plane as the clip
> function.
> 
>  
> 
> For the images I have ImageReslice -> ImageMapToWindowLevelColors ->
> ImageActor
> 
>  
> 
> Both of these actors are connected to a Renderer and added to a
> RenderWindow.
> 
>  
> 
> What I get is a slice and half of a sphere floating over it.  I can't
> get the circle to be reflected on the image.  I've also tried to use an
> ImageViewer2 for the display to no avail.
> 
>  
> 
> My original plan was to sync the plane definitions in the ImageReslice
> and the clipping plane, but I can't get past this point.
> 
>  
> 
> This seems much more difficult than it needs to be.  Is there a simpler
> way?
> 
>  
> 
> Thanks
> 
>  
> 
>                                 -- Scott
> 
>  
> 

-- 
GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.!
http://portal.gmx.net/de/go/dsl02



More information about the vtkusers mailing list