No subject


Wed Oct 7 22:37:18 EDT 2009


geometry through GetPoints( ) or topology through GetLines( ), GetVerts(),
GetPolys( ),...

In your case (from what I read  in your code), contour is a vtkAlgorithm. I=
t
cannot be its own output in the same time.

I hope that helps

Jerome

2009/10/26 Alessandro Artusi <artusialessandro4 at googlemail.com>

> Dear Bill thanks a lot but it does not work I have still the same Attribu=
te
> error.
>
> I repeat contour is where i store the output of teh vtkContourFilter(), m=
ay
> be it does not inerithance the GetPoints().....
>
> Any other suggestion?
>
> The vtkContourFilter has not any
>
> On Mon, Oct 26, 2009 at 2:44 PM, Bill Lorensen <bill.lorensen at gmail.com>w=
rote:
>
>> You must do
>> contour.Update()
>>
>> before accessing the points.
>>
>> On Mon, Oct 26, 2009 at 8:26 AM, Alessandro Artusi
>> <artusialessandro4 at googlemail.com> wrote:
>> > Thanks a lot Jerome,
>> >
>> > I get an errore:
>> >
>> > AttributeError GetPoints.
>> >
>> > May be I am doing something wrong; what i  am doing is the following:
>> >
>> > contour =3D vtk.vtkContourFilter()
>> > contour.SetInput(grid) #grid is rectilineargrid()
>> > contour.ComputeNormalOn()
>> > contour.SetValue(0, 95) #my isovalue
>> >
>> > in contour i should have my polyData right?
>> >
>> > when i do what you suggested:
>> >
>> > contour.GetPoints( ).GetPoint( pointId, coord )
>> >
>> > I got the error.
>> >
>> > Any suggestion?
>> >
>> > Thanks again,
>> > Alessandro.
>> >
>> >
>> > On Mon, Oct 26, 2009 at 1:11 PM, J=E9r=F4me <jerome.velut at gmail.com> w=
rote:
>> >>
>> >> Hi,
>> >> vtkPolyData is a vtkPointSet : you can access points coordinates
>> through
>> >>
>> >> polydata->GetPoints( )->GetPoint( pointId, coord )
>> >>
>> >> where polydata is your... polydata, pointId is the point Id you want =
to
>> >> get (from 0 to NumberOfPoints - 1) and coord is double coord[3] fille=
d
>> by
>> >> the point coordinate.
>> >>
>> >> HTH
>> >> Jerome
>> >>
>> >> 2009/10/26 Alessandro Artusi <artusialessandro4 at googlemail.com>
>> >>>
>> >>> Dear All,
>> >>>
>> >>> I have a vtkPolyData from the vtkContourFilter and I need to get the
>> >>> X,Y,Z coordinates of each point in the PolyData. This because I need
>> to
>> >>> convert them.
>> >>> How can i get this info?
>> >>>
>> >>> Thanks a lot for teh help,
>> >>> Alessandro.
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> Powered by www.kitware.com
>> >>>
>> >>> Visit other Kitware open-source projects at
>> >>> http://www.kitware.com/opensource/opensource.html
>> >>>
>> >>> Please keep messages on-topic and check the VTK FAQ at:
>> >>> http://www.vtk.org/Wiki/VTK_FAQ
>> >>>
>> >>> Follow this link to subscribe/unsubscribe:
>> >>> http://www.vtk.org/mailman/listinfo/vtkusers
>> >>>
>> >>
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>> >
>>
>
>

--0016e6db2b0a2bb6230476d695fa
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

In your code, you defined contour as the vtkContourFilter, not a polydata. =
vtkContourFilter is a subclass of vtkAlgorithm that does not have a GetPoin=
ts( ) function. You should take a look to VTK online documentation to see w=
hat you can access from a class.<br>
Basically, a subclass of vtkAlgorithm allows you to access input/ouput that=
 could be vtkPointSet<br>From vtkPointSet (such as vtkPolyData, your intere=
st...), you can acces geometry through GetPoints( ) or topology through Get=
Lines( ), GetVerts(), GetPolys( ),...<br>
<br>In your case (from what I read=A0 in your code), contour is a vtkAlgori=
thm. It cannot be its own output in the same time. <br><br>I hope that help=
s<br><br>Jerome<br><br><div class=3D"gmail_quote">2009/10/26 Alessandro Art=
usi <span dir=3D"ltr">&lt;<a href=3D"mailto:artusialessandro4 at googlemail.co=
m">artusialessandro4 at googlemail.com</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Dear Bill th=
anks a lot but it does not work I have still the same Attribute error.</div=
>

<div>=A0</div>
<div>I repeat contour is where i store the output of teh vtkContourFilter()=
, may be it does not inerithance the GetPoints().....</div>
<div>=A0</div>
<div>Any other suggestion?</div>
<div>=A0</div>
<div>The vtkContourFilter has not any <br><br></div><div><div></div><div cl=
ass=3D"h5">
<div class=3D"gmail_quote">On Mon, Oct 26, 2009 at 2:44 PM, Bill Lorensen <=
span dir=3D"ltr">&lt;<a href=3D"mailto:bill.lorensen at gmail.com" target=3D"_=
blank">bill.lorensen at gmail.com</a>&gt;</span> wrote:<br>
<blockquote style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0px=
 0px 0px 0.8ex; padding-left: 1ex;" class=3D"gmail_quote">You must do<br>co=
ntour.Update()<br><br>before accessing the points.<br>
<div>
<div></div>
<div><br>On Mon, Oct 26, 2009 at 8:26 AM, Alessandro Artusi<br>&lt;<a href=
=3D"mailto:artusialessandro4 at googlemail.com" target=3D"_blank">artusialessa=
ndro4 at googlemail.com</a>&gt; wrote:<br>&gt; Thanks a lot Jerome,<br>&gt;<br=
>

&gt; I get an errore:<br>&gt;<br>&gt; AttributeError GetPoints.<br>&gt;<br>=
&gt; May be I am doing something wrong; what i =A0am doing is the following=
:<br>&gt;<br>&gt; contour =3D vtk.vtkContourFilter()<br>&gt; contour.SetInp=
ut(grid) #grid is rectilineargrid()<br>

&gt; contour.ComputeNormalOn()<br>&gt; contour.SetValue(0, 95) #my isovalue=
<br>&gt;<br>&gt; in contour i should have my polyData right?<br>&gt;<br>&gt=
; when i do what=A0you suggested:<br>&gt;<br>&gt; contour.GetPoints( ).GetP=
oint( pointId, coord )<br>

&gt;<br>&gt; I got the error.<br>&gt;<br>&gt; Any suggestion?<br>&gt;<br>&g=
t; Thanks again,<br>&gt; Alessandro.<br>&gt;<br>&gt;<br>&gt; On Mon, Oct 26=
, 2009 at 1:11 PM, J=E9r=F4me &lt;<a href=3D"mailto:jerome.velut at gmail.com"=
 target=3D"_blank">jerome.velut at gmail.com</a>&gt; wrote:<br>

&gt;&gt;<br>&gt;&gt; Hi,<br>&gt;&gt; vtkPolyData is a vtkPointSet : you can=
 access points coordinates through<br>&gt;&gt;<br>&gt;&gt; polydata-&gt;Get=
Points( )-&gt;GetPoint( pointId, coord )<br>&gt;&gt;<br>&gt;&gt; where poly=
data is your... polydata, pointId is the point Id you want to<br>

&gt;&gt; get (from 0 to NumberOfPoints - 1) and coord is double coord[3] fi=
lled by<br>&gt;&gt; the point coordinate.<br>&gt;&gt;<br>&gt;&gt; HTH<br>&g=
t;&gt; Jerome<br>&gt;&gt;<br>&gt;&gt; 2009/10/26 Alessandro Artusi &lt;<a h=
ref=3D"mailto:artusialessandro4 at googlemail.com" target=3D"_blank">artusiale=
ssandro4 at googlemail.com</a>&gt;<br>

&gt;&gt;&gt;<br>&gt;&gt;&gt; Dear All,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I ha=
ve a vtkPolyData from the vtkContourFilter and I need to get the<br>&gt;&gt=
;&gt; X,Y,Z coordinates of each point in the PolyData. This because I need =
to<br>

&gt;&gt;&gt; convert them.<br>&gt;&gt;&gt; How can i get this info?<br>&gt;=
&gt;&gt;<br>&gt;&gt;&gt; Thanks a lot for teh help,<br>&gt;&gt;&gt; Alessan=
dro.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; ______________________=
_________________________<br>

&gt;&gt;&gt; Powered by <a href=3D"http://www.kitware.com/" target=3D"_blan=
k">www.kitware.com</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Visit other Kitware =
open-source projects at<br>&gt;&gt;&gt; <a href=3D"http://www.kitware.com/o=
pensource/opensource.html" target=3D"_blank">http://www.kitware.com/opensou=
rce/opensource.html</a><br>

&gt;&gt;&gt;<br>&gt;&gt;&gt; Please keep messages on-topic and check the VT=
K FAQ at:<br>&gt;&gt;&gt; <a href=3D"http://www.vtk.org/Wiki/VTK_FAQ" targe=
t=3D"_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt;&gt;&gt;<br>&gt;&gt=
;&gt; Follow this link to subscribe/unsubscribe:<br>

&gt;&gt;&gt; <a href=3D"http://www.vtk.org/mailman/listinfo/vtkusers" targe=
t=3D"_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;&gt;&g=
t;<br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt; ____________________________________=
___________<br>

&gt; Powered by <a href=3D"http://www.kitware.com/" target=3D"_blank">www.k=
itware.com</a><br>&gt;<br>&gt; Visit other Kitware open-source projects at<=
br>&gt; <a href=3D"http://www.kitware.com/opensource/opensource.html" targe=
t=3D"_blank">http://www.kitware.com/opensource/opensource.html</a><br>

&gt;<br>&gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt=
; <a href=3D"http://www.vtk.org/Wiki/VTK_FAQ" target=3D"_blank">http://www.=
vtk.org/Wiki/VTK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsu=
bscribe:<br>

&gt; <a href=3D"http://www.vtk.org/mailman/listinfo/vtkusers" target=3D"_bl=
ank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;<br>&gt;<br></=
div></div></blockquote></div><br>
</div></div></blockquote></div><br>

--0016e6db2b0a2bb6230476d695fa--


More information about the vtkusers mailing list