[vtkusers] Outline of a result from a vtkimagereslicemapper

Doug Hoppes dhoppes at mbfbioscience.com
Thu Sep 25 10:40:10 EDT 2014

Thanks for the reply, David.  I still think that I'm missing something obvious (once I get the outline working, I'll add the tube filter).

Here's the pipeline that I'm trying to implement but the outlines seems to be a small box in the upper corner of my volume rather than outlining the slice.

// Create the plane to cut into the volume
m_pSlicePlane = vtkSmartPointer<vtkPlane>::New();

// the slice mapper extracts a slice from the volume
m_pSliceMapper = vtkSmartPointer<vtkImageResliceMapper>::New();

// Set it up so that the slice is not affected by the current lighting situation
vtkSmartPointer<vtkImageProperty> m_sliceProperty = vtkSmartPointer<vtkImageProperty>::New();

// Create the mapper to display the slice
m_pSliceActor = vtkSmartPointer<vtkImageSlice>::New();

// Add the slice to the scene

// Cut the slice plane so that we can put an outline around it
vtkSmartPointer<vtkCutter> pCutter = vtkSmartPointer<vtkCutter>::New();

// setup the outline actor
vtkSmartPointer<vtkOutlineFilter> pOutlineFilter = vtkSmartPointer<vtkOutlineFilter>::New();

// Create the mapper to display the outline
vtkSmartPointer<vtkPolyDataMapper> pOutlineMapper = vtkSmartPointer<vtkPolyDataMapper>::New();

// Create the actor to display the outline
m_pOutlineActor = vtkSmartPointer<vtkActor>::New();

// Add the actor to the scene

From: David Gobbi [mailto:david.gobbi at gmail.com]
Sent: Thursday, September 18, 2014 4:22 PM
To: Doug Hoppes
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Outline of a result from a vtkimagereslicemapper

Hi Doug,

In order to create a polydata that outlines the slice, you'll need
to use the vtkCutter:

1) use GenerateFacesOn() on the vtkOutlineFilter to make it create
a closed box

2) use vtkCutter to cut the box with the slice plane from the mapper
(mapper->GetSlicePlane() or mapper->GetSlicePlaneInDataCoords())
in order to create a polyline that outlines the slice

3) I also recommend passing the polyline through vtkTubeFilter in
order to give the outline a finite thickness

 - David

On Thu, Sep 18, 2014 at 1:00 PM, Doug Hoppes <dhoppes at mbfbioscience.com<mailto:dhoppes at mbfbioscience.com>> wrote:
Hi all,

                I've gotten the image reslice mapper working beautifully for my image volume.  However, I'm trying to get the outline filter to work so that I can show a bound region around my image slice.  All I'm showing is a small square in the upper left corner:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140925/90d6c7a4/attachment.html>

More information about the vtkusers mailing list