<DIV>Hi Dean, </DIV>
<DIV> </DIV>
<DIV>Thanks for help. I made the changes, but it changes nothing. </DIV>
<DIV> </DIV>
<DIV>however, I just found my mistake, so I let it know. </DIV>
<DIV> </DIV>
<DIV>To avoid dealing with memory and to enable a faster access, I set at the beginning:</DIV>
<DIV> </DIV>
<DIV><STRONG>vtkpoints* points = vtkPoints::New();<BR>points->SetNumberOfPoints(100);</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV>Then, after each click, the world position is stored in vtkPoint* points and a vtkSphereSource is positionned at the point.</DIV>
<DIV> </DIV>
<DIV>Now I realise that, if I pick only 3 points, then the rest of vtkPoint* points (97 points) store (0,0,0). That's why I have lines passing through my spheres, instead of having a spline interpolating them. </DIV>
<DIV> </DIV>
<DIV>Isabelle</DIV>
<DIV> </DIV>
<DIV><BR><B><I>Dean Inglis <dean.inglis@camris.ca></I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Isabelle,<BR><BR><BR>see edits below. You have to turn on ProjectToPlane and set<BR>the projection position.<BR><BR>Dean<BR><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>splineWidget->SetInput(m_Actor->GetInput());//vtkImageActor<BR>splineWidget->SetInteractor(m_RenderWindow->GetInteractor());<BR><BR>double bounds[6];<BR>m_Actor->GetBounds(bounds);<BR><BR>splineWidget->ProjectToPlaneOn(); // you need to do this to make the spline<BR>reside planar<BR>double pos = 0.0;<BR><BR>if ( bounds[0] == bounds[1] ) // a y-z plane<BR>{<BR>splineWidget->SetProjectionNormalToXAxes();<BR>pos = bounds[0];<BR>}<BR>else if ( bounds[2] == bounds[3] ) // a x-z
plane<BR>{<BR>splineWidget->SetProjectionNormalToYAxes();<BR>pos = bounds[2];<BR>}<BR>else if ( bounds[4] == bounds[5] ) // a x-y plane<BR>{<BR>splineWidget->SetProjectionNormalToZAxes();<BR>}<BR>else<BR>{<BR>splineWidget->SetProjectionNormalToOblique(); // you need to do other<BR>things to make this work, see docs<BR>}<BR><BR>splineWidget->SetProjectionPosition(pos);<BR><BR><BR>splineWidget->PlaceWidget(bounds);<BR>splineWidget->ClosedOn();<BR><BR><BR>//leftbuttonpressed handle<BR>static int numberOfNodes = 0;<BR>void vtkSliceViewer::SelectPoint( double x, double y, double z )<BR>{<BR><BR>if(numberOfNodes <100)<BR>{<BR>// Store the point with no range checking or memory allocation.<BR>points->SetPoint( nodeId, x,y,z );<BR>numberOfNodes ++;<BR><BR>if(numberOfNodes >=2)<BR>{<BR>splineWidget->InitializeHandles(points);<BR>// splineWidget->SetProjectionNormalToZAxes(); // don't need to do this<BR>here<BR>// splineWidget->SetProjectionPosition(z); //
don't need to do this here<BR>splineWidget->On();<BR>this->Render();<BR>}<BR>}<BR><BR><BR><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/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>