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"><<a href=3D"mailto:artusialessandro4 at googlemail.co=
m">artusialessandro4 at googlemail.com</a>></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"><<a href=3D"mailto:bill.lorensen at gmail.com" target=3D"_=
blank">bill.lorensen at gmail.com</a>></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><<a href=
=3D"mailto:artusialessandro4 at googlemail.com" target=3D"_blank">artusialessa=
ndro4 at googlemail.com</a>> wrote:<br>> Thanks a lot Jerome,<br>><br=
>
> I get an errore:<br>><br>> AttributeError GetPoints.<br>><br>=
> May be I am doing something wrong; what i =A0am doing is the following=
:<br>><br>> contour =3D vtk.vtkContourFilter()<br>> contour.SetInp=
ut(grid) #grid is rectilineargrid()<br>
> contour.ComputeNormalOn()<br>> contour.SetValue(0, 95) #my isovalue=
<br>><br>> in contour i should have my polyData right?<br>><br>>=
; when i do what=A0you suggested:<br>><br>> contour.GetPoints( ).GetP=
oint( pointId, coord )<br>
><br>> I got the error.<br>><br>> Any suggestion?<br>><br>&g=
t; Thanks again,<br>> Alessandro.<br>><br>><br>> On Mon, Oct 26=
, 2009 at 1:11 PM, J=E9r=F4me <<a href=3D"mailto:jerome.velut at gmail.com"=
target=3D"_blank">jerome.velut at gmail.com</a>> wrote:<br>
>><br>>> Hi,<br>>> vtkPolyData is a vtkPointSet : you can=
access points coordinates through<br>>><br>>> polydata->Get=
Points( )->GetPoint( pointId, coord )<br>>><br>>> where poly=
data is your... polydata, pointId is the point Id you want to<br>
>> get (from 0 to NumberOfPoints - 1) and coord is double coord[3] fi=
lled by<br>>> the point coordinate.<br>>><br>>> HTH<br>&g=
t;> Jerome<br>>><br>>> 2009/10/26 Alessandro Artusi <<a h=
ref=3D"mailto:artusialessandro4 at googlemail.com" target=3D"_blank">artusiale=
ssandro4 at googlemail.com</a>><br>
>>><br>>>> Dear All,<br>>>><br>>>> I ha=
ve a vtkPolyData from the vtkContourFilter and I need to get the<br>>>=
;> X,Y,Z coordinates of each point in the PolyData. This because I need =
to<br>
>>> convert them.<br>>>> How can i get this info?<br>>=
>><br>>>> Thanks a lot for teh help,<br>>>> Alessan=
dro.<br>>>><br>>>><br>>>> ______________________=
_________________________<br>
>>> Powered by <a href=3D"http://www.kitware.com/" target=3D"_blan=
k">www.kitware.com</a><br>>>><br>>>> Visit other Kitware =
open-source projects at<br>>>> <a href=3D"http://www.kitware.com/o=
pensource/opensource.html" target=3D"_blank">http://www.kitware.com/opensou=
rce/opensource.html</a><br>
>>><br>>>> Please keep messages on-topic and check the VT=
K FAQ at:<br>>>> <a href=3D"http://www.vtk.org/Wiki/VTK_FAQ" targe=
t=3D"_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>>>><br>>>=
;> Follow this link to subscribe/unsubscribe:<br>
>>> <a href=3D"http://www.vtk.org/mailman/listinfo/vtkusers" targe=
t=3D"_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>>>&g=
t;<br>>><br>><br>><br>> ____________________________________=
___________<br>
> Powered by <a href=3D"http://www.kitware.com/" target=3D"_blank">www.k=
itware.com</a><br>><br>> Visit other Kitware open-source projects at<=
br>> <a href=3D"http://www.kitware.com/opensource/opensource.html" targe=
t=3D"_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>> Please keep messages on-topic and check the VTK FAQ at:<br>>=
; <a href=3D"http://www.vtk.org/Wiki/VTK_FAQ" target=3D"_blank">http://www.=
vtk.org/Wiki/VTK_FAQ</a><br>><br>> Follow this link to subscribe/unsu=
bscribe:<br>
> <a href=3D"http://www.vtk.org/mailman/listinfo/vtkusers" target=3D"_bl=
ank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>><br>><br></=
div></div></blockquote></div><br>
</div></div></blockquote></div><br>
--0016e6db2b0a2bb6230476d695fa--
More information about the vtkusers
mailing list