<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">------------<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Create the plane to cut into the volume<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSlicePlane</span><span style="font-size:10.0pt;font-family:"Courier New""> =
<span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkPlane</span>>::<span style="color:#010001">New</span>();
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// the slice mapper extracts a slice from the volume<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSliceMapper</span><span style="font-size:10.0pt;font-family:"Courier New""> =
<span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkImageResliceMapper</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSliceMapper</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetInputData</span>(<span style="color:#010001">GetImageDefinition</span>()-><span style="color:#010001">GetImage</span>()-><span style="color:#010001">GetImageData</span>());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSliceMapper</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetSlicePlane</span>(<span style="color:#010001">m_pSlicePlane</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Set it up so that the slice is not affected by the current lighting situation<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">vtkSmartPointer</span><span style="font-size:10.0pt;font-family:"Courier New""><<span style="color:#010001">vtkImageProperty</span>>
<span style="color:#010001">m_sliceProperty</span> = <span style="color:#010001">
vtkSmartPointer</span><<span style="color:#010001">vtkImageProperty</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_sliceProperty</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetAmbient</span>(1.0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_sliceProperty</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetDiffuse</span>(0.0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_sliceProperty</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetOpacity</span>(1.0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_sliceProperty</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetInterpolationTypeToLinear</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Create the mapper to display the slice<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSliceActor</span><span style="font-size:10.0pt;font-family:"Courier New""> =
<span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkImageSlice</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSliceActor</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetMapper</span>(<span style="color:#010001">m_pSliceMapper</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSliceActor</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetProperty</span>(<span style="color:#010001">m_sliceProperty</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Add the slice to the scene<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSceneManager</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">AddActor</span>(<span style="color:#010001">m_pSliceActor</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Cut the slice plane so that we can put an outline around it<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">vtkSmartPointer</span><span style="font-size:10.0pt;font-family:"Courier New""><<span style="color:#010001">vtkCutter</span>>
<span style="color:#010001">pCutter</span> = <span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkCutter</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">pCutter</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetCutFunction</span>(<span style="color:#010001">m_pSliceMapper</span>-><span style="color:#010001">GetSlicePlane</span>());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">pCutter</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetInputConnection</span>(<span style="color:#010001">m_pSliceMapper</span>-><span style="color:#010001">GetOutputPort</span>());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// setup the outline actor<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">vtkSmartPointer</span><span style="font-size:10.0pt;font-family:"Courier New""><<span style="color:#010001">vtkOutlineFilter</span>>
<span style="color:#010001">pOutlineFilter</span> = <span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkOutlineFilter</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">pOutlineFilter</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">GenerateFacesOn</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">pOutlineFilter</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetInputConnection</span>(<span style="color:#010001">pCutter</span>-><span style="color:#010001">GetOutputPort</span>());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Create the mapper to display the outline<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">vtkSmartPointer</span><span style="font-size:10.0pt;font-family:"Courier New""><<span style="color:#010001">vtkPolyDataMapper</span>>
<span style="color:#010001">pOutlineMapper</span> = <span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkPolyDataMapper</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">pOutlineMapper</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetInputConnection</span>(<span style="color:#010001">pOutlineFilter</span>-><span style="color:#010001">GetOutputPort</span>());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Create the actor to display the outline<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pOutlineActor</span><span style="font-size:10.0pt;font-family:"Courier New""> =
<span style="color:#010001">vtkSmartPointer</span><<span style="color:#010001">vtkActor</span>>::<span style="color:#010001">New</span>();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pOutlineActor</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">GetProperty</span>()-><span style="color:#010001">SetColor</span>(1.0,1,0);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pOutlineActor</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">GetProperty</span>()-><span style="color:#010001">SetLineWidth</span>(10);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pOutlineActor</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">SetMapper</span>(<span style="color:#010001">pOutlineMapper</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:green">// Add the actor to the scene<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:#010001">m_pSceneManager</span><span style="font-size:10.0pt;font-family:"Courier New"">-><span style="color:#010001">AddActor</span>(<span style="color:#010001">m_pOutlineActor</span>);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David Gobbi [mailto:david.gobbi@gmail.com]
<br>
<b>Sent:</b> Thursday, September 18, 2014 4:22 PM<br>
<b>To:</b> Doug Hoppes<br>
<b>Cc:</b> vtkusers@vtk.org<br>
<b>Subject:</b> Re: [vtkusers] Outline of a result from a vtkimagereslicemapper<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Doug,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In order to create a polydata that outlines the slice, you'll need<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">to use the vtkCutter:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">1) use GenerateFacesOn() on the vtkOutlineFilter to make it create<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">a closed box<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">2) use vtkCutter to cut the box with the slice plane from the mapper<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">(mapper->GetSlicePlane() or mapper->GetSlicePlaneInDataCoords())<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">in order to create a polyline that outlines the slice<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">3) I also recommend passing the polyline through vtkTubeFilter in<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">order to give the outline a finite thickness<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> - David<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Sep 18, 2014 at 1:00 PM, Doug Hoppes <<a href="mailto:dhoppes@mbfbioscience.com" target="_blank">dhoppes@mbfbioscience.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi all,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> 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:<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>