<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:11.0pt;
font-family:"Calibri","sans-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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.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">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> 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>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><img width="647" height="236" id="Picture_x0020_6" src="cid:image001.png@01CFD350.75909DD0"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The code that I’m using is:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">First Function<o:p></o:p></p>
<p class="MsoNormal">---------------------------<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:green">// Create the plane that will hold the slice results<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">m_pSlicePlane</span> = <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"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:green">// extract a slice from the volume<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">m_pSliceMapper</span> = <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"">
<span style="color:#010001">m_pSliceMapper</span>-><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"">
<span style="color:#010001">m_pSliceMapper</span>-><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"">
<span style="color:green">// Set it up so that the slice is not affected by the current lighting situation<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">vtkSmartPointer</span><<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"">
<span style="color:#010001">m_sliceProperty</span>-><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"">
<span style="color:#010001">m_sliceProperty</span>-><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"">
<span style="color:#010001">m_sliceProperty</span>-><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"">
<span style="color:#010001">m_sliceProperty</span>-><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"">
<span style="color:green">// Create the mapper to display the slice<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">m_pSliceActor</span> = <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"">
<span style="color:#010001">m_pSliceActor</span>-><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"">
<span style="color:#010001">m_pSliceActor</span>-><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"">
<span style="color:green">// Add the slice to the scene<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">m_pSceneManager</span>-><span style="color:#010001">AddActor</span>(<span style="color:#010001">m_pSliceActor</span>);<o:p></o:p></span></p>
<p class="MsoNormal">---------------------------<o:p></o:p></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""><o:p> </o:p></span></p>
<p class="MsoNormal">Another Function<o:p></o:p></p>
<p class="MsoNormal">---------------------------<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:green">// setup the outline actor<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">vtkSmartPointer</span><<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"">
<span style="color:#010001">pOutlineFilter</span>-><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"">
<span style="color:#010001">vtkSmartPointer</span><<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"">
<span style="color:#010001">pOutlineMapper</span>-><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"">
<span style="color:green">// Set the color of the slice<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:blue">double</span> <span style="color:#010001">rgbColor</span>[3];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">SolidsColor</span>::<span style="color:#010001">ToVTKRGB</span>(<span style="color:#010001">rgbColor</span>,
<span style="color:#010001">GetImageDefinition</span>()-><span style="color:#010001">GetColor</span>());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">m_pOutlineActor</span>-><span style="color:#010001">GetProperty</span>()-><span style="color:#010001">SetColor</span>(<span style="color:#010001">rgbColor</span>[0],
<span style="color:#010001">rgbColor</span>[1], <span style="color:#010001">rgbColor</span>[2]);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#010001">m_pOutlineActor</span>-><span style="color:#010001">SetMapper</span>(<span style="color:#010001">pOutlineMapper</span>);<o:p></o:p></span></p>
<p class="MsoNormal">---------------------------<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">Doug Hoppes I
</span></b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">Senior Software Engineer<b> I</b>
<img width="46" height="32" id="Picture_x0020_1" src="cid:image002.png@01CFD350.75909DD0" alt="cid:image007.png@01CEF686.037AE7C0"><b><o:p></o:p></b></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#296DC1">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#296DC1">T</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">: 802-288-9290
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#296DC1">E</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">:
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="mailto:dhoppes@mbfbioscience.com"><span style="color:blue">dhoppes@mbfbioscience.com</span></a><span style="color:#404040"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#296DC1"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">MBF Bioscience<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">185 Allen Brook Lane<b>
<o:p></o:p></b></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">Williston, VT 05495 USA<o:p></o:p></span></p>
<p class="MsoNormal"><a href="http://www.mbfbioscience.com/"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">www.mbfbioscience.com</span></a><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040"><o:p></o:p></span></p>
<p class="MsoNormal"><a href="http://www.mbfbioscience.com/blog"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040">http://www.mbfbioscience.com/blog</span></a><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><a href="http://www.facebook.com/mbfbioscience"><span style="font-family:"Arial","sans-serif";color:#404040;text-decoration:none"><img border="0" width="19" height="19" id="Picture_x0020_2" src="cid:image003.png@01CFD350.75909DD0" alt="cid:image008.png@01CEF686.037AE7C0"></span></a><span style="font-family:"Arial","sans-serif";color:#404040"> </span><a href="http://www.linkedin.com/company/mbf-bioscience"><span style="font-family:"Arial","sans-serif";color:blue;text-decoration:none"><img border="0" width="19" height="19" id="Picture_x0020_3" src="cid:image004.png@01CFD350.75909DD0" alt="cid:image011.png@01CEF686.037AE7C0"></span></a><span style="font-family:"Arial","sans-serif";color:#404040"> </span><a href="http://www.youtube.com/mbfbioscience"><span style="font-family:"Arial","sans-serif";color:blue;text-decoration:none"><img border="0" width="19" height="19" id="Picture_x0020_4" src="cid:image005.png@01CFD350.75909DD0" alt="cid:image012.png@01CEF686.037AE7C0"></span></a><span style="font-family:"Arial","sans-serif";color:#404040"> </span><a href="http://www.twitter.com/mbfbioscience"><span style="font-family:"Arial","sans-serif";color:blue;text-decoration:none"><img border="0" width="19" height="19" id="Picture_x0020_5" src="cid:image006.png@01CFD350.75909DD0" alt="cid:image014.png@01CEF686.037AE7C0"></span></a><span style="font-family:"Arial","sans-serif";color:#404040"> </span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#404040"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>