<div dir="ltr"><div>I could be wrong but programmable source doesn't have a SetRequestDataObjectMethod or a SetFillOutputPortInformation method which is where you might change that.</div><div><br></div><div>I recommend you use the new vtkPyhtonAlgorithm instead.<br></div><div><a href="http://www.kitware.com/blog/home/post/737">http://www.kitware.com/blog/home/post/737</a><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Fri, Jan 15, 2016 at 12:08 PM, Bryan Cole <span dir="ltr"><<a href="mailto:bryan.cole@teraview.com" target="_blank">bryan.cole@teraview.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<br>
I'm trying to use a vtkProgrammableSource to create a StructuredPoints output using python and VTK-6.0.0. My test script is below.<br>
<br>
This fails with the error "ERROR: In /builddir/build/BUILD/VTK6.0.0/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 815<br>
vtkCompositeDataPipeline (0x2253f50): Input for connection index 0 on input port index 0 for algorithm vtkClipVolume(0x224e050) is of type vtkPolyData, but a vtkImageData is required."<br>
<br>
I.e. the programmable source is always giving a vtkPolyData output to the downstream filter (vtkClipVolume) instead of the desired<br>
StructuredPoints dataset. What am I doing wrong?<br>
<br>
Thanks,<br>
BC<br>
<br>
##############example#############<br>
import vtk<br>
<br>
src = vtk.vtkProgrammableSource()<br>
def make_grid():<br>
sp = src.GetStructurePointsOutput()<br>
sp.SetDimensions(50,50,50)<br>
sp.SetOrigin(-10,-10,-10)<br>
sp.SetSpacing(0.4,0.4,0.4)<br>
<br>
src.SetExecuteMethod(make_grid)<br>
<br>
func = vtk.vtkSphere()<br>
func.SetCenter(0,0,0)<br>
func.SetRadius(5.0)<br>
<br>
clip = vtk.vtkClipVolume()<br>
clip.SetInputConnection(src.GetOutputPort())<br>
clip.SetClipFunction(func)<br>
<br>
map = vtk.vtkPolyDataMapper()<br>
map.SetInputConnection(clip.GetOutputPort())<br>
map.ScalarVisibilityOff()<br>
<br>
surfaceActor = vtk.vtkActor()<br>
surfaceActor.SetMapper(map)<br>
<br>
# Create the RenderWindow, Renderer and both Actors<br>
ren = vtk.vtkRenderer()<br>
renWin = vtk.vtkRenderWindow()<br>
renWin.AddRenderer(ren)<br>
iren = vtk.vtkRenderWindowInteractor()<br>
iren.SetRenderWindow(renWin)<br>
<br>
# Add the actors to the renderer, set the background and size<br>
ren.AddActor(surfaceActor)<br>
<br>
iren.Initialize()<br>
renWin.Render()<br>
iren.Start()<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
<table cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>-- <br>
Group Leader, Technical Development Group - Teraview Ltd.<br>
Platinum Building, St. John's Innovation Park, Cambridge CB4 0DS, UK.<br>
tel: <a href="tel:%2B44%20%280%291223%20435386" value="+441223435386" target="_blank">+44 (0)1223 435386</a>, fax: <a href="tel:%2B44%20%280%291223%20435382" value="+441223435382" target="_blank">+44 (0)1223 435382</a>, web: <a href="http://www.teraview.com/" target="_blank">www.teraview.com</a> Registered Number: 04126946, VAT Number: 770 8883 84<br>
<br>
...preferred document formats: ODF (ISO/IEC 26300:2006), PDF </td>
</tr>
</tbody>
</table>
</font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>