<div dir="ltr"><div><div><div>Hi all,<br><br></div>I had an additional question.  I'd like to convert this script into a Custom Filter using the <a href="http://www.kitware.com/blog/home/post/534">python_filter_generator.py script</a>, but this requires the output type to be set automatically.  Is that possible with the Programmable Filter, i.e., is it possible to set the output type without manually using the drop-down menu?<br><br></div>Thanks,<br></div>Evan Kao<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 25, 2015 at 11:35 AM, Evan Kao <span dir="ltr"><<a href="mailto:tossin@gmail.com" target="_blank">tossin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Jean!  That did the trick.<span class="HOEnZb"><font color="#888888"><div><br></div><div>- Evan</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 25, 2015 at 12:16 AM, Favre  Jean <span dir="ltr"><<a href="mailto:jfavre@cscs.ch" target="_blank">jfavre@cscs.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><font face="arial,helvetica,sans-serif"><font size="2">You are missing a RequestInformation Script to indicate the dimensions of the grid you wish to create.<br>
<br>
Set the type of the Output Data to "vtkStructuredGrid"<br>
<br>
you will need, at the minimum, the following two sections of python code<br>
<br>
in the "Script"</font><br>
<br>
</font><font face="arial,helvetica,sans-serif"></font><span style="font-family:'Courier New,courier'">mbds
</span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> inputs[</span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">]</span><font face="arial,helvetica,sans-serif">
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">block<font face="arial,helvetica,sans-serif">0</font> </span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> mbds</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">GetBlock(</span><span style="font-family:'Courier New,courier';color:#666666"><font face="arial,helvetica,sans-serif">0</font></span><span style="font-family:'Courier New,courier'">)</span></pre>
<pre style="margin-top:0px;margin-bottom:12px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">output</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">ShallowCopy(block<font face="arial,helvetica,sans-serif">0</font>)</span></pre>
</font><font size="2" face="Arial">(make sure to toggle the Advanced Properties to make the second text input widget to appear, and fill in the "</font><font face="arial,helvetica,sans-serif"><font size="2" face="Arial">RequestInformation Script" with the following
 text:<br>
</font><br>
</font>
<pre style="margin-top:12px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">executive </span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> </span><span style="font-family:'Courier New,courier';color:#008000">self</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">GetExecutive()</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">outInfo </span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> executive</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">GetOutputInformation(</span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">mbds </span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> inputs[</span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">]</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">block0 </span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> mbds</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">GetBlock(</span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">dims </span><span style="font-family:'Courier New,courier';color:#666666">=</span><span style="font-family:'Courier New,courier'"> block0</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">GetDimensions()</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'Courier New,courier'">outInfo</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">Set(executive</span><span style="font-family:'Courier New,courier';color:#666666">.</span><span style="font-family:'Courier New,courier'">WHOLE_EXTENT(), </span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">, dims[</span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">]</span><span style="font-family:'Courier New,courier';color:#666666">-1</span><span style="font-family:'Courier New,courier'"> , </span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">, dims[</span><span style="font-family:'Courier New,courier';color:#666666">1</span><span style="font-family:'Courier New,courier'">]</span><span style="font-family:'Courier New,courier';color:#666666">-1</span><span style="font-family:'Courier New,courier'"> , </span><span style="font-family:'Courier New,courier';color:#666666">0</span><span style="font-family:'Courier New,courier'">, dims[</span><span style="font-family:'Courier New,courier';color:#666666">2</span><span style="font-family:'Courier New,courier'">]</span><span style="font-family:'Courier New,courier';color:#666666">-1</span><span style="font-family:'Courier New,courier'">)</span><br><br><font size="2" face="Arial">==============<br>That's all!<br><br>Jean/CSCS</font><br>
</pre>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div></div>
</div>
</div>
</div>

</blockquote></div><br></div>
</div></div></blockquote></div><br></div>