<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi David,<br><br>It certainly seems to be the Stencil filter that is slowing the system down. I am trying to use vtkPolyDataToImageStencil to see if that would be any faster, but I'm having some difficulties.<br><br>I replaced this ImplicitFunction code:<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkImplicitSelectionLoop&gt; ImplicitLoop = vtkSmartPointer&lt;vtkImplicitSelectionLoop&gt;::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ImplicitLoop-&gt;SetLoop(points);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkImplicitFunctionToImageStencil&gt; dataToStencil = vtkSmartPointer&lt;vtkImplicitFunctionToImageStencil&gt;::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dataToStencil-&gt;SetInput(ImplicitLoop);<br><br>with this PolyData code:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkCellArray&gt; polygons = vtkSmartPointer&lt;vtkCellArray&gt;::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolygon&gt; polygon = vtkSmartPointer&lt;vtkPolygon&gt;::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; polygon-&gt;GetPointIds()-&gt;SetNumberOfIds(4); //make a quad<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; polygon-&gt;GetPointIds()-&gt;SetId(0, 0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; polygon-&gt;GetPointIds()-&gt;SetId(1, 1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; polygon-&gt;GetPointIds()-&gt;SetId(2, 2);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; polygon-&gt;GetPointIds()-&gt;SetId(3, 3);<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; polygons-&gt;InsertNextCell(polygon);<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolyData&gt; quad = vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; quad-&gt;SetPoints(points);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; quad-&gt;SetPolys(polygons);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkPolyDataToImageStencil&gt; dataToStencil = vtkSmartPointer&lt;vtkPolyDataToImageStencil&gt;::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dataToStencil-&gt;SetInput(quad);<br><br>The final image does not show the stencil with the PolyData code. Is there a difference in the implementation of the 2 filters where I would have a different output or need a different input? Also, should I expect to see any increase in performance by using PolyData instead of ImplicitFunction? Thanks for all your answers!<br><br>Cheers,<br>Alexis Cheng<br>Electrical Engineering<br>University of British Columbia<br><br><br><br>&gt; From: david.gobbi@gmail.com<br>&gt; Date: Mon, 1 Nov 2010 19:27:40 -0600<br>&gt; Subject: Re: [vtkusers] vtkBlend Output<br>&gt; To: acheng_1221@hotmail.com<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; Hi Alexis,<br>&gt; <br>&gt; Have you tried it without the stencil, for comparison?  The<br>&gt; vtkImplicitFunctionToImageStencil filter is very slow.<br>&gt; <br>&gt;   David<br>&gt; <br>&gt; <br>&gt; On Mon, Nov 1, 2010 at 5:57 PM, Alexis Cheng &lt;acheng_1221@hotmail.com&gt; wrote:<br>&gt; &gt; Hi all,<br>&gt; &gt;<br>&gt; &gt; Is vtkBlend extremely resource intensive? I have a following piece of code<br>&gt; &gt; running: FinalImage is a vtkImageData object, MTImage is a vtkImageData<br>&gt; &gt; object, and blend1 is a vtkImageBlend object.<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blend1-&gt;SetStencil(dataToStencil-&gt;GetOutput());<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blend1-&gt;AddInput(MTImage);<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blend1-&gt;AddInput(BlackImage);<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blend1-&gt;SetOpacity(0,0.5);<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blend1-&gt;SetOpacity(1,0.5);<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(OutOfView)<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FinalImage = MTImage;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FinalImage = blend1-&gt;GetOutput();<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FinalImage-&gt;Update();<br>&gt; &gt;<br>&gt; &gt; The fps of my display decreases dramatically whenever the output from blend<br>&gt; &gt; is requested. Is this behaviour expected? Thanks in advance.<br>&gt; &gt;<br>&gt; &gt; Cheers,<br>&gt; &gt; Alexis Cheng<br>&gt; &gt; Electrical Engineering<br>&gt; &gt; University of British Columbia<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;<br>&gt; &gt; Visit other Kitware open-source projects at<br>&gt; &gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;<br>&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; &gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;<br>&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; &gt;<br>&gt; &gt;<br>                                               </body>
</html>