Actually, to answer my own question, Structured data can be segmented by adding<br><pre>from paraview import util
self.GetExecutive().SetExtentTranslator(self.GetExecutive().GetOutputInformation(0),
vtk.vtkExtentTranslator())<br></pre>To the RequestInformation box in the programmable filter and therefore I no longer have a problem daisy-chaining different types of filters.<br><br>Although all datatypes can be segmented now, the bug where when the filter is initially applied is still present. The data is not segmented until the dataset is reread with the filter already applied.<br>
<br>Another thing that I ran into is that if I use vtkThreshold on the segmented data, the threshold filter will somehow grab the entire extent of the data and output the threshold of the entire data (per processor) even you you give it the segmented input. As of result you have a thresholded dataset that is (thresholded data size) * (number of processors)  large. Here is some sample code with the output set to vtkUnstructuredGrid<br>
<br>script<br>---------<br>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">import time </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">import paraview.vtk.parallel</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">myProcId = 0</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">numProcs = 1</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">controller = paraview.vtk.parallel.vtkMultiProcessController.GetGlobalController()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">if controller:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    myProcId = controller.GetLocalProcessId()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    numProcs = controller.GetNumberOfProcesses()</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">input  = self.GetInputDataObject(0, 0) # Safer method</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">output = self.GetOutput()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">indim = input.GetDimensions()</p>
<p style="margin: 0px; text-indent: 0px;">print(str(myProcId) + &quot;&gt;&gt; input dimensions: &quot; + str(indim[0]) + &quot; &quot; + str(indim[1]) + &quot; &quot; + str(indim[2]) + &quot;\n&quot;)</p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<br></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">#Threshold the data</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">t1 = time.clock()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">thresh = vtk.vtkThreshold()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">thresh.SetInput(input)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">thresh.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_POINTS, &quot;volume_scalars&quot;);</p>

<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">thresh.ThresholdBetween(2, 3)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">thresh.Update()</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">output.ShallowCopy(thresh.GetOutput())</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">print(&quot;Time spent thresholding: &quot; + str(time.clock()-t1) + &quot;\n&quot;)</p>
<p style="margin: 0px; text-indent: 0px;">print(str(myProcId) + &quot; is done!\n&quot;)</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">------------<br></p><p style="margin: 0px; text-indent: 0px;">
Requestinformation script (Although for vtkUnstructuredData the input is already segmented)</p><p style="margin: 0px; text-indent: 0px;">---------------</p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</p>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">from paraview import util</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">self.GetExecutive().SetExtentTranslator(self.GetExecutive().GetOutputInformation(0),</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">vtk.vtkExtentTranslator())</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p><br><br>Would this be considered correct?<br><br>Jesus<br><br><br><div class="gmail_quote">
On Fri, Aug 26, 2011 at 9:33 AM, Jesus Pulido <span dir="ltr">&lt;<a href="mailto:jpulido@ucdavis.edu">jpulido@ucdavis.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br><br>I am working on various python programmable filters and have gotten them working in parallel but I&#39;ve ran into some problems and have questions on some of the functionality. I am working with (structured) vtkImageData loaded in from a .pvti file (4 pieces) and will want to ideally output vtkUnstructuredData for some of my filters, and vtkImageData for others. I am not sure if Paraview is supposed to segment the input/output data for you but what I&#39;ve found out is that it will depending on the set output data type.<br>

<br>If you choose vtkPolyData, vtkStructuredGrid, vtkRectilinearGrid, vtkImageData, and vtkUniformGrid, and print the input extents for each processor that&#39;s running the filter, the input will be that of the entire dataset. (and therefore each pvserver will read in the entire dataset into memory!)<br>

<br>If you choose vtkUnstructuredGrid or vtkMultiBlockData, then the input will be segmented into pieces and printing the extents of the data for each processor running the filter will show the input segmented. <br><br>Now, my question is if this behavior is normal/expected? If it is, is there a filter that I may call within my filter to segment my data to only include piece X our of N processors available?<br>

<br>Regarding the output data, I&#39;m assuming each processor is expecting a certain extent of the data and Paraview will combine the output of all processors into one object, but when I output the &quot;output&quot; extents (out = self.GetOutput()), the extents are set to the entire dataset size by default.<br>

<br>I&#39;ve also found a bug within the datatypes in which inputs are segmented. When a filter is initially added and applied to a dataset, outputting the extents of the inputs shows that each processor is loading the entire extent of the data. If you have a dataset with multiple timesteps or are able to force Paraview to re-read the dataset with the filter already set, you will see that the &quot;correct&quot; segmented extents are now passed through to the filter for each core.<br>

<br>Another, perhaps bug, is that if daisy-chain two python programmable filters, the first one being one of the two datatypes that segment the data, and then the second being one that doesnt segment the data, the inputs for the first filter will no longer be segmented anymore.<br>
<font color="#888888">
<br>Jesus<br>
</font></blockquote></div><br>