<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> vtkSmartPointer<vtkImplicitSelectionLoop> ImplicitLoop = vtkSmartPointer<vtkImplicitSelectionLoop>::New();<br> ImplicitLoop->SetLoop(points);<br><br> vtkSmartPointer<vtkImplicitFunctionToImageStencil> dataToStencil = vtkSmartPointer<vtkImplicitFunctionToImageStencil>::New();<br> dataToStencil->SetInput(ImplicitLoop);<br><br>with this PolyData code:<br><br> vtkSmartPointer<vtkCellArray> polygons = vtkSmartPointer<vtkCellArray>::New();<br> vtkSmartPointer<vtkPolygon> polygon = vtkSmartPointer<vtkPolygon>::New();<br> polygon->GetPointIds()->SetNumberOfIds(4); //make a quad<br> polygon->GetPointIds()->SetId(0, 0);<br> polygon->GetPointIds()->SetId(1, 1);<br> polygon->GetPointIds()->SetId(2, 2);<br> polygon->GetPointIds()->SetId(3, 3);<br> <br> polygons->InsertNextCell(polygon);<br> <br> vtkSmartPointer<vtkPolyData> quad = vtkSmartPointer<vtkPolyData>::New();<br> quad->SetPoints(points);<br> quad->SetPolys(polygons);<br><br> vtkSmartPointer<vtkPolyDataToImageStencil> dataToStencil = vtkSmartPointer<vtkPolyDataToImageStencil>::New();<br> dataToStencil->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>> From: david.gobbi@gmail.com<br>> Date: Mon, 1 Nov 2010 19:27:40 -0600<br>> Subject: Re: [vtkusers] vtkBlend Output<br>> To: acheng_1221@hotmail.com<br>> CC: vtkusers@vtk.org<br>> <br>> Hi Alexis,<br>> <br>> Have you tried it without the stencil, for comparison? The<br>> vtkImplicitFunctionToImageStencil filter is very slow.<br>> <br>> David<br>> <br>> <br>> On Mon, Nov 1, 2010 at 5:57 PM, Alexis Cheng <acheng_1221@hotmail.com> wrote:<br>> > Hi all,<br>> ><br>> > Is vtkBlend extremely resource intensive? I have a following piece of code<br>> > running: FinalImage is a vtkImageData object, MTImage is a vtkImageData<br>> > object, and blend1 is a vtkImageBlend object.<br>> ><br>> > blend1->SetStencil(dataToStencil->GetOutput());<br>> > blend1->AddInput(MTImage);<br>> > blend1->AddInput(BlackImage);<br>> > blend1->SetOpacity(0,0.5);<br>> > blend1->SetOpacity(1,0.5);<br>> ><br>> > if(OutOfView)<br>> > {<br>> > FinalImage = MTImage;<br>> > }<br>> > else<br>> > {<br>> > FinalImage = blend1->GetOutput();<br>> > }<br>> > FinalImage->Update();<br>> ><br>> > The fps of my display decreases dramatically whenever the output from blend<br>> > is requested. Is this behaviour expected? Thanks in advance.<br>> ><br>> > Cheers,<br>> > Alexis Cheng<br>> > Electrical Engineering<br>> > University of British Columbia<br>> ><br>> > _______________________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at<br>> > http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the VTK FAQ at:<br>> > http://www.vtk.org/Wiki/VTK_FAQ<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://www.vtk.org/mailman/listinfo/vtkusers<br>> ><br>> ><br>                                            </body>
</html>