<DIV>Does anyone have more examples about how to use vtkSplineWidget, except those in VTK folder?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Isabelle<BR><BR><B><I>Renaud Isabelle &lt;renauisa@yahoo.fr&gt;</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-&gt;SetNumberOfPoints( 100);<BR><BR>splineWidget = vtkSplineWidget::New();<BR>splineWidget-&gt;SetCurrentRenderer(m_Renderer);<BR>splineWidget-&gt;SetDefaultRenderer(m_Renderer);<BR><BR><BR>splineWidget-&gt;SetInput(m_Actor-&gt;GetInput());//vtkImageActor<BR><BR>splineWidget-&gt;SetInteractor(m_RenderWindow-&gt;GetInteractor());<BR>splineWidget-&gt;PlaceWidget(m_Actor-&gt;GetBounds());<BR>splineWidget-&gt;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 &lt;100)<BR>{<BR>points-&gt;SetPoint( nodeId, x,y,z ); <BR>numberOfNodes ++; <BR><BR>if(numberOfNodes &gt;=2)<BR>{<BR>splineWidget-&gt;InitializeHandles(points);<BR>splineWidget-&gt;SetProjectionNormalToZAxes();<BR>splineWidget-&gt;SetProjectionPosition(z);<BR>splineWidget-&gt;On();<BR>this-&gt;Render();<BR>} <BR>}<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt;
 Dean Inglis <DEAN.INGLIS@CAMRIS.CA>a écrit :<BR>&gt; &gt; why don't you just use the<BR>&gt; &gt; new vtkParametricSpline and<BR>&gt; vtkParametricFunctionSource<BR>&gt; &gt; classes? That way you just insert a vtkPoints<BR>&gt; containing<BR>&gt; &gt; the points to fit a spline to into a<BR>&gt; &gt; vtkParametricSpline and then<BR>&gt; vtkParametricFunctionSource<BR>&gt; &gt; generates the polydata for you.<BR>&gt; &gt; Have a look at cvs vtkSplineWidget<BR>&gt; &gt; to see how this is can be done.<BR>&gt; &gt; <BR>&gt; &gt; Dean<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; -----Original Message-----<BR>&gt; &gt; From: Renaud Isabelle [mailto:renauisa@yahoo.fr]<BR>&gt; &gt; Sent: Monday, September 12, 2005 11:48 AM<BR>&gt; &gt; To: Dean Inglis; vtkusers archive<BR>&gt; &gt; Subject: RE: [vtkusers] splines<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; Hi,<BR>&gt; &gt; <BR>&gt; &gt; - i tried this but it didn't change anything.<BR>&gt; &gt; <BR>&gt; &gt; - i have a question: do you know if
 my parameter t<BR>&gt; has to be a float between<BR>&gt; &gt; 0 and 1?<BR>&gt; &gt; <BR>&gt; &gt; When I traced spline_points, here is what I got:<BR>&gt; &gt; <BR>&gt; &gt; t=0.000000, spline points:13.035959 10.105188<BR>&gt; 0.000000<BR>&gt; &gt; t=5.210526, spline<BR>&gt; &gt; points:-434367840.000000 -434367840.000000<BR>&gt; -434367840.000000<BR>&gt; &gt; t=10.421053, spline<BR>&gt; &gt; points:-431597504.000000 -431597504.000000<BR>&gt; -431597504.000000<BR>&gt; &gt; t=15.631579, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=20.842106, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=26.052631, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=31.263159, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=36.473682, spline<BR>&gt; &gt; points:-431602080.000000
 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=41.684212, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=46.894737, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=52.105263, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=57.315788, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=62.526318, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=67.736839, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=72.947365, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=78.157898, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=83.368423,
 spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=88.578949, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=93.789474, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; t=99.000000, spline<BR>&gt; &gt; points:-431602080.000000 -431602080.000000<BR>&gt; -431602080.000000<BR>&gt; &gt; <BR>&gt; &gt; Maybe t could be the problem. I saw many examples:<BR>&gt; &gt; - sometimes t is defined as:<BR>&gt; &gt; t = ( (float)numberOfInputPoints - 1.0 ) / (<BR>&gt; (float)numberOfOutputPoints -<BR>&gt; &gt; 1.0 ) * (float)i;<BR>&gt; &gt; <BR>&gt; &gt; - sometimes length of the polyline is used, such<BR>&gt; as vtkSplineFilter:<BR>&gt; &gt; t=len/length as cumulative distance<BR>&gt; &gt; <BR>&gt; &gt; BTW, i tried to use vtkSplineFilter but i couldn't<BR>&gt; compile: undefined<BR>&gt; &gt; identifier vtkGarbageCollector in<BR>&gt;
 vtkAlgortihm??????????<BR>&gt; &gt; <BR>&gt; &gt; Please help,<BR>&gt; &gt; <BR>&gt; &gt; Isabelle<BR>&gt; &gt; <BR>&gt; &gt; Dean Inglis a écrit :<BR>&gt; &gt; sorry, I missed that.<BR>&gt; &gt; <BR>&gt; &gt; Maybe it's because you call Reset()<BR>&gt; &gt; without setting the number of points.<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; if(spline_points) spline_points-&gt;Reset(); float t<BR>&gt; = 0.0;<BR>&gt; <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>