<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Andrea,</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You can use vtkThreshold on any scalar field
data by using SelectInputScalars(). Add the threshold data to your UGrid using AddArray()
instead of SetScalars(). The properties you want to display are added as the
active scalars.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>HTH</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>John.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
vtkusers-bounces+jcplatt=dsl.pipex.com@vtk.org
[mailto:vtkusers-bounces+jcplatt=dsl.pipex.com@vtk.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Andrea Gavana<br>
<b><span style='font-weight:bold'>Sent:</span></b> 31 March 2006 17:13<br>
<b><span style='font-weight:bold'>To:</span></b> vtkusers@public.kitware.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [vtkusers] Re:
vtkThreshold Question</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Hello Goodwin,</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp; thank
you very much for your help. It seems to me (if I have read correctly the doc),
that vtkExtractCells requires a vtkDataSet, a file in other words... is that
correct? </span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Well, I already have a
vtkUnstructuredGrid built by reading an external file (not VTK format). The
idea of extracting cells based on Ids implemented in vtkExtractCells is very
promising... there is nothing similar but without using a vtkDataSet? </span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>The problem is, I should
be able to filter out cells by certain criteria: for example, at the moment I
am trying to exclude inactive cells using this ACTNUM, but I would like to be
able to filter out the cell based on, i.e., cell centroid depth, cell
permeability, cell saturations and so on. This seems to me something like a
vtkFilter*, and if every time I set up a new filter I have to create a file and
re-read it I will end up in doing slow things. I am too newbie to&nbsp;browse
in the right doc&nbsp;places... </span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Thank you very much for
your suggestions.</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Andrea.<br>
<br>
&nbsp;</span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><span class=gmailquote><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>On 3/31/06, <b><span
style='font-weight:bold'>Goodwin Lawlor</span></b> &lt;<a
href="mailto:goodwin.lawlor@ucd.ie">goodwin.lawlor@ucd.ie</a>&gt; wrote:</span></font></span>
</p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Andrea Gavana wrote:<br>
&gt; Hello NG,<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; sorry if this question is simple, but I have
searched over the web <br>
&gt; and I have't found anything close to what I should so. Basically, I have<br>
&gt; a vtkUnstructuredGrid in which I set the cell data using some property.<br>
&gt; By switching with a wxPython radiobutton I can change on the fly the <br>
&gt; property displayed on the grid (like permeability, saturation, cell<br>
&gt; centroids and so on). Well, my group of data has also a property called<br>
&gt; &quot;ACTNUM&quot;, that tells which cells are active (ACTNUM=1) and which
are not <br>
&gt; active (ACTNUM=0). Active cells should be displayed while inactive cells<br>
&gt; should be hidden.<br>
&gt; I have succeeded to use vtkThreshold to filter out inactive cells, but<br>
&gt; only when I set cell_data=ACTNUM, using something like: <br>
&gt;<br>
&gt; grid.GetCellData().SetScalars(ACTNUM)<br>
&gt;<br>
&gt; What I would like to do is, whatever property is displayed on screen, to<br>
&gt; hide inactive cells based on ACTNUM value. For example, I would like to <br>
&gt; display cell centroids property on the grid filtering out inactive<br>
&gt; cells. Something like:<br>
&gt;<br>
&gt; grid.GetCellData().SetScalars(Whatever)<br>
&gt; ??? Apply threshold on grid using ACTNUM ???<br>
&gt; <br>
&gt; Is there a way to do this?<br>
&gt;<br>
&gt; Thank you very much for your help and suggestions.<br>
&gt;<br>
&gt; Andrea.<br>
Hi Andrea,<br>
<br>
You could try vtkExtractCells to filter out cells. You would have to<br>
loop through ACTNUM and create the appropriate vtkIdList to apply to the <br>
filter. Alternatively, you could try to convert your scalars to RGBA<br>
values, where ACTNUM determines the A value (the opacity).<br>
<br>
hth<br>
<br>
Goodwin<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list. <br>
Please keep messages on-topic. Check the FAQ at: <a
href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a></span></font></p>

</div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br clear=all>
<br>
-- <br>
&quot;Imagination Is The Only Weapon In The War Against Reality.&quot;<br>
<br>
<a href="http://xoomer.virgilio.it/infinity77/">http://xoomer.virgilio.it/infinity77/</a></span></font></p>

</div>

</body>

</html>