<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>Just to clarify, are these 2 classes available right now or is there a review process?<br><br>Thanks,<br>Alexis Cheng<br>Electrical Engineering<br>University of British Columbia<br><br>> From: david.gobbi@gmail.com<br>> Date: Thu, 4 Nov 2010 07:57:11 -0600<br>> Subject: Re: [vtkusers] vtkBlend Output<br>> To: acheng_1221@hotmail.com<br>> CC: vtkusers@vtk.org<br>> <br>> I've just committed two new classes for generating stencils:<br>> 1) Imaging/vtkROIStencilSource - rectangles and ellipses<br>> 2) Imaging/vtkLassooStencilSource - polygons and splines<br>> <br>> David<br>> <br>> On Wed, Nov 3, 2010 at 8:52 AM, David Gobbi <david.gobbi@gmail.com> wrote:<br>> > Hi Alexis,<br>> ><br>> > The PolyDataToImageStencil filter requires a closed 3D polydata<br>> > surface, like a box or a sphere. It does not work with 2D contours.<br>> ><br>> > I have a "lassoo" class based on some of my old python code for doing<br>> > ROI stencils, but it is incomplete. It would work like<br>> > ImplicitSelectionLoop for vtkImageStencilData, but a few hundred times<br>> > faster. I'll take a look at it today to see how much work it would be<br>> > to finish it and contribute it to VTK.<br>> ><br>> > David<br>> ><br>> > On Tue, Nov 2, 2010 at 6:07 PM, Alexis Cheng <acheng_1221@hotmail.com> wrote:<br>> >> Hi David,<br>> >><br>> >> It certainly seems to be the Stencil filter that is slowing the system down.<br>> >> I am trying to use vtkPolyDataToImageStencil to see if that would be any<br>> >> faster, but I'm having some difficulties.<br>> >><br>> >> I replaced this ImplicitFunction code:<br>> >><br>> >> vtkSmartPointer<vtkImplicitSelectionLoop> ImplicitLoop =<br>> >> vtkSmartPointer<vtkImplicitSelectionLoop>::New();<br>> >> ImplicitLoop->SetLoop(points);<br>> >><br>> >> vtkSmartPointer<vtkImplicitFunctionToImageStencil> dataToStencil =<br>> >> vtkSmartPointer<vtkImplicitFunctionToImageStencil>::New();<br>> >> dataToStencil->SetInput(ImplicitLoop);<br>> >><br>> >> with this PolyData code:<br>> >><br>> >> vtkSmartPointer<vtkCellArray> polygons =<br>> >> vtkSmartPointer<vtkCellArray>::New();<br>> >> vtkSmartPointer<vtkPolygon> polygon =<br>> >> 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 =<br>> >> vtkSmartPointer<vtkPolyData>::New();<br>> >> quad->SetPoints(points);<br>> >> quad->SetPolys(polygons);<br>> >><br>> >> vtkSmartPointer<vtkPolyDataToImageStencil> dataToStencil =<br>> >> vtkSmartPointer<vtkPolyDataToImageStencil>::New();<br>> >> dataToStencil->SetInput(quad);<br>> >><br>> >> The final image does not show the stencil with the PolyData code. Is there a<br>> >> difference in the implementation of the 2 filters where I would have a<br>> >> different output or need a different input? Also, should I expect to see any<br>> >> increase in performance by using PolyData instead of ImplicitFunction?<br>> >> 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><br>> >>> wrote:<br>> >>> > Hi all,<br>> >>> ><br>> >>> > Is vtkBlend extremely resource intensive? I have a following piece of<br>> >>> > 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<br>> >>> > 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>> >><br>> ><br>                                            </body>
</html>