<DIV>Does anyone have more examples about how to use vtkSplineWidget, except those in VTK folder?</DIV>
<DIV> </DIV>
<DIV>Isabelle<BR><BR><B><I>Renaud Isabelle <renauisa@yahoo.fr></I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi,<BR><BR>I followed your advice and had a look on<BR>vtkSplineWidget: It seems to do exactly all I have<BR>tried to do without success. Moreover, it could<BR>simplify my code a lot. Thanksa lot. <BR><BR>So, i tried to implement it: however, it seems<BR>that I missed something about projection or<BR>something else.: the points (handle geometries) are<BR>positionned correctly on my figure exactly where I<BR>click. However, the splines passing through are just<BR>parallel lines (no curve, no spline). <BR><BR>In fact, I am using vtkImageActor to display just<BR>one Z slice of my 3D image. So I thought that my<BR>projection plane should be normal to Z axis. I tried<BR>each possibility: SetProjectionNormalToXAxes,<BR>SetProjectionNormalToYAxes,<BR>SetProjectionNormalToZAxes. All I have is parallel<BR>lines.<BR><BR>Could you have a look, please? <BR>Isabelle<BR><BR>points =
vtkPoints::New();<BR>points->SetNumberOfPoints( 100);<BR><BR>splineWidget = vtkSplineWidget::New();<BR>splineWidget->SetCurrentRenderer(m_Renderer);<BR>splineWidget->SetDefaultRenderer(m_Renderer);<BR><BR><BR>splineWidget->SetInput(m_Actor->GetInput());//vtkImageActor<BR><BR>splineWidget->SetInteractor(m_RenderWindow->GetInteractor());<BR>splineWidget->PlaceWidget(m_Actor->GetBounds());<BR>splineWidget->ClosedOn();<BR><BR>//leftbuttonpressed handle<BR>static int numberOfNodes = 0;<BR>void vtkSliceViewer::SelectPoint( double x, double<BR>y, double z )<BR>{<BR>if(numberOfNodes <100)<BR>{<BR>points->SetPoint( nodeId, x,y,z ); <BR>numberOfNodes ++; <BR><BR>if(numberOfNodes >=2)<BR>{<BR>splineWidget->InitializeHandles(points);<BR>splineWidget->SetProjectionNormalToZAxes();<BR>splineWidget->SetProjectionPosition(z);<BR>splineWidget->On();<BR>this->Render();<BR>} <BR>}<BR>> > <BR>> > <BR>> > <BR>> > <BR>> >
Dean Inglis <DEAN.INGLIS@CAMRIS.CA>a écrit :<BR>> > why don't you just use the<BR>> > new vtkParametricSpline and<BR>> vtkParametricFunctionSource<BR>> > classes? That way you just insert a vtkPoints<BR>> containing<BR>> > the points to fit a spline to into a<BR>> > vtkParametricSpline and then<BR>> vtkParametricFunctionSource<BR>> > generates the polydata for you.<BR>> > Have a look at cvs vtkSplineWidget<BR>> > to see how this is can be done.<BR>> > <BR>> > Dean<BR>> > <BR>> > <BR>> > -----Original Message-----<BR>> > From: Renaud Isabelle [mailto:renauisa@yahoo.fr]<BR>> > Sent: Monday, September 12, 2005 11:48 AM<BR>> > To: Dean Inglis; vtkusers archive<BR>> > Subject: RE: [vtkusers] splines<BR>> > <BR>> > <BR>> > Hi,<BR>> > <BR>> > - i tried this but it didn't change anything.<BR>> > <BR>> > - i have a question: do you know if
my parameter t<BR>> has to be a float between<BR>> > 0 and 1?<BR>> > <BR>> > When I traced spline_points, here is what I got:<BR>> > <BR>> > t=0.000000, spline points:13.035959 10.105188<BR>> 0.000000<BR>> > t=5.210526, spline<BR>> > points:-434367840.000000 -434367840.000000<BR>> -434367840.000000<BR>> > t=10.421053, spline<BR>> > points:-431597504.000000 -431597504.000000<BR>> -431597504.000000<BR>> > t=15.631579, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=20.842106, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=26.052631, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=31.263159, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=36.473682, spline<BR>> > points:-431602080.000000
-431602080.000000<BR>> -431602080.000000<BR>> > t=41.684212, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=46.894737, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=52.105263, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=57.315788, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=62.526318, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=67.736839, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=72.947365, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=78.157898, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=83.368423,
spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=88.578949, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=93.789474, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > t=99.000000, spline<BR>> > points:-431602080.000000 -431602080.000000<BR>> -431602080.000000<BR>> > <BR>> > Maybe t could be the problem. I saw many examples:<BR>> > - sometimes t is defined as:<BR>> > t = ( (float)numberOfInputPoints - 1.0 ) / (<BR>> (float)numberOfOutputPoints -<BR>> > 1.0 ) * (float)i;<BR>> > <BR>> > - sometimes length of the polyline is used, such<BR>> as vtkSplineFilter:<BR>> > t=len/length as cumulative distance<BR>> > <BR>> > BTW, i tried to use vtkSplineFilter but i couldn't<BR>> compile: undefined<BR>> > identifier vtkGarbageCollector in<BR>>
vtkAlgortihm??????????<BR>> > <BR>> > Please help,<BR>> > <BR>> > Isabelle<BR>> > <BR>> > Dean Inglis a écrit :<BR>> > sorry, I missed that.<BR>> > <BR>> > Maybe it's because you call Reset()<BR>> > without setting the number of points.<BR>> > <BR>> > <BR>> > if(spline_points) spline_points->Reset(); float t<BR>> = 0.0;<BR>> <BR>=== message truncated ===<BR><BR><BR><BR><BR><BR><BR><BR>___________________________________________________________________________ <BR>Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger <BR>Téléchargez cette version sur http://fr.messenger.yahoo.com<BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE><p>
                <hr size=1>
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br>
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/yahoofr/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>