No subject
Wed Oct 7 22:37:18 EDT 2009
x,y,z coordinates making use of the function available to vtkContourFilter.
Any suggestion?
Thanks again.
Alessandro.
On Mon, Oct 26, 2009 at 3:31 PM, J=E9r=F4me <jerome.velut at gmail.com> wrote:
> In your code, you defined contour as the vtkContourFilter, not a polydata=
.
> vtkContourFilter is a subclass of vtkAlgorithm that does not have a
> GetPoints( ) function. You should take a look to VTK online documentation=
to
> see what you can access from a class.
> Basically, a subclass of vtkAlgorithm allows you to access input/ouput th=
at
> could be vtkPointSet
> From vtkPointSet (such as vtkPolyData, your interest...), you can acces
> geometry through GetPoints( ) or topology through GetLines( ), GetVerts()=
,
> GetPolys( ),...
>
> In your case (from what I read in your code), contour is a vtkAlgorithm.
> It 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
>> Attribute error.
>>
>> I repeat contour is where i store the output of teh vtkContourFilter(),
>> may 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.co=
m
>> > wrote:
>>
>>> 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>
>>> wrote:
>>> >>
>>> >> 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] fill=
ed
>>> 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 th=
e
>>> >>> X,Y,Z coordinates of each point in the PolyData. This because I nee=
d
>>> 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
>>> >
>>> >
>>>
>>
>>
>
--000e0ce0091ebe059a0476d6d68a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>Thanks Jerome,</div>
<div>=A0</div>
<div>it is very helpfull your explanation. In my case what i can use to get=
the info that i need.</div>
<div>From the Online documentation is not clear to me how the get access to=
the x,y,z coordinates making use of the function available to vtkContourFi=
lter. Any suggestion?<br></div>
<div>Thanks again.</div>
<div>Alessandro.<br></div>
<div class=3D"gmail_quote">On Mon, Oct 26, 2009 at 3:31 PM, J=E9r=F4me <spa=
n dir=3D"ltr"><<a href=3D"mailto:jerome.velut at gmail.com">jerome.velut at gm=
ail.com</a>></span> wrote:<br>
<blockquote style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3D"gmail_quote">In your code, you defined contou=
r as the vtkContourFilter, not a polydata. vtkContourFilter is a subclass o=
f vtkAlgorithm that does not have a GetPoints( ) function. You should take =
a look to VTK online documentation to see what 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=20
<div>
<div></div>
<div class=3D"h5"><br><br>Jerome<br><br>
<div class=3D"gmail_quote">2009/10/26 Alessandro Artusi <span dir=3D"ltr">&=
lt;<a href=3D"mailto:artusialessandro4 at googlemail.com" target=3D"_blank">ar=
tusialessandro4 at googlemail.com</a>></span><br>
<blockquote style=3D"BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0=
pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=3D"gmail_quote">
<div>Dear Bill thanks a lot but it does not work I have still the same Attr=
ibute 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>
<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: rgb(204,204,204) 1px solid; MARGIN: 0px 0=
px 0px 0.8ex; PADDING-LEFT: 1ex" class=3D"gmail_quote">You must do<br>conto=
ur.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></div><=
/div>
</blockquote></div><br>
--000e0ce0091ebe059a0476d6d68a--
More information about the vtkusers
mailing list