<div dir="ltr"><span style="font-size:13px">Announce the whole extent in the RequestInformation script section.<br></span><span style="font-size:13px">That should do the trick.</span><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:12px;line-height:16.799999237060547px;text-align:justify;background-color:rgb(250,250,250)"><br></span></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 Thu, Jan 22, 2015 at 11:17 AM, Bruce Jones <span dir="ltr"><<a href="mailto:bruce.david.jones@gmail.com" target="_blank">bruce.david.jones@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<div><br></div><div>I'm working on a programmable filter that needs to produce a vtkImageData object. So far it appears to work, inspection of the properties panel shows the object has the correct number of points/cells and the data array contains the correct data. However I cannot get a visualisation with any of the representations (surface, outline, wireframe etc). Curiously, if i set the display to my data array then the color bar appears with the correct values, but still not visualization.</div><div><br></div><div>I am using the following code to produce the image data object.</div><div><br></div><div>from vtk import *<br></div><div><br></div><div><div>output = self.GetOutputDataObject(0);</div><div><br></div><div># Create a VTK Grid<br></div><div>grid = vtkImageData()</div><div>grid.SetOrigin(0, 0, 0) # default values</div><div>dx=10;</div><div>grid.SetSpacing(dx, dx, dx)</div><div>grid.SetDimensions(5, 8, 10) # number of points in each direction</div><div># print grid.GetNumberOfPoints()</div><div># print grid.GetNumberOfCells()</div><div>array = vtkDoubleArray()</div><div>array.SetNumberOfComponents(1) # this is 3 for a vector</div><div>array.SetNumberOfTuples(grid.GetNumberOfPoints())</div><div>for i in range(grid.GetNumberOfPoints()):</div><div> if i < 200:</div><div> array.SetValue(i, 1)</div><div> else:</div><div> array.SetValue(i, 2)</div><div><br></div><div>grid.GetPointData().AddArray(array)</div><div># print grid.GetPointData().GetNumberOfArrays()</div><div>array.SetName("unit array")</div><div>output.ShallowCopy(grid);</div></div><div><br></div><div>Cheers,</div><div>Bruce</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>