Hi David,<div><br></div><div>Thanks... that is exactly what I want to do. I was wondering, how does it manage missing points. </div><div><br></div><div>Another thing, I tried to compile the test program on vtk documentation website</div>
<div><br></div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob_plain;f=Filters/Hybrid/Testing/Cxx/TestBSplineWarp.cxx">http://vtk.org/gitweb?p=VTK.git;a=blob_plain;f=Filters/Hybrid/Testing/Cxx/TestBSplineWarp.cxx</a></div>
<div><br></div><div>and I get an error as, </div><div><br></div><div>error: ‘class vtkBSplineTransform’ has no member named ‘SetCoefficientData’.</div><div><br></div><div>Thanks,</div><div>Anant.<br>
<br><div class="gmail_quote">On Fri, Sep 14, 2012 at 2:37 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Anant,<br>
<br>
If you recompute the spline coefficients within the transform's<br>
Update() method, then it should provide the sort of pipeline behavior<br>
that you are looking for. The following paper describes the VTK<br>
transform update mechanism:<br>
<a href="http://www.ncbi.nlm.nih.gov/pubmed/12631510" target="_blank">http://www.ncbi.nlm.nih.gov/pubmed/12631510</a><br>
<br>
I added a vtkBSplineTransform to VTK 5.10. It might satisfy your<br>
needs, and if not, you might be able to re-use parts of it:<br>
<a href="http://hdl.handle.net/10380/3252" target="_blank">http://hdl.handle.net/10380/3252</a><br>
<span><font color="#888888"><br>
- David<br>
</font></span><div><div><br>
On Fri, Sep 14, 2012 at 4:02 AM, Anant Vemuri <<a href="mailto:ajar108@gmail.com" target="_blank">ajar108@gmail.com</a>> wrote:<br>
> I am currently creating a spline using vtkSplineFilter. The points in the<br>
> spline are changing as new positions for points are generated. However, now<br>
> I want to put the position information into a vtkTransform and connect the<br>
> Spline being created within a pipeline so that, it gets updated when the the<br>
> transform changes.<br>
><br>
> currently I am doing this whenever I get new positions. Is it possible to<br>
> put this in a pipeline so that the points are updated using a vtktransform<br>
> when the transform changes. In vtkTransform there is a function called<br>
> "MultiplyPoint" and "TransformPoint", however both are not indicated to be<br>
> pipelined.<br>
><br>
> I am curious if anyone has tried to do this, or if anyone has suggestions on<br>
> this issue.<br>
><br>
> myspline is a class containing vtkPoints, vtkPolyLine, vtkPolyData etc.<br>
><br>
><br>
> // In the constructor for my spline class<br>
> _points = vtkSmartPointer< vtkPoints >::New();<br>
> _polyLine = vtkSmartPointer< vtkPolyLine >::New();<br>
> _cells = vtkSmartPointer< vtkCellArray >::New();<br>
> _polyData = vtkSmartPointer< vtkPolyData >::New();<br>
> _splineFilter = vtkSmartPointer< vtkSplineFilter >::New();<br>
> _tubeFilter = vtkSmartPointer< vtkTubeFilter >::New();<br>
><br>
> // PIPELINE<br>
> _cells->InsertNextCell(_polyLine);<br>
> _polyData->SetPoints(_points);<br>
> _polyData->SetLines(_cells);<br>
> _splinefilter->SetInput( _polyData );<br>
> _splinefilter->SetMaximumNumberOfSubdivisions( 48 );<br>
> _tubeFilter->SetInputConnection( _splineFilter->GetOutputPort());<br>
> _tubeFilter->SetNumberOfSides( 12 );<br>
> _tubeFilter->SetRadius( 5.0 );<br>
> _tubeFilter->SetCapping(true);<br>
> _mapper->SetInputConnection( _tubeFilter->GetOutputPort() );<br>
> _actor->SetMapper(_mapper);<br>
> _actor->GetProperty()->SetLineWidth(4);<br>
><br>
> //----------------------------------------------------------------<br>
> // Updating for new vtkpoints<br>
><br>
> // I want to put this part into the pipeline if possible so that<br>
> // i can apply a vtkTransform to lets say the _points and the spline<br>
> // gets updated automatically. The updated _points that I get are<br>
><br>
> // absolute positions so I cannot appl<br>
> splineObj->getPoints()->Reset();<br>
> splineObj->getPolyLine()->GetPointIds()->Reset();<br>
> vtkIdType k = 0;<br>
><br>
> // __scanorder contains the order in which the points need to be put<br>
> into a spline<br>
> // __positions contains the updated point locations<br>
> for (int j = 0; j < __scanOrder.size(); j++)<br>
> {<br>
> unsigned int __idx = __scanOrder[i][j]-1;<br>
> double &__coord = __positions[__idx]->getCoordinate();<br>
><br>
><br>
> splineObj->getPoints()->InsertNextPoint(__coord[0],__coord[1],__coord[2]);<br>
> splineObj->getPolyLine()->GetPointIds()->InsertNextId( k );<br>
> k++;<br>
> }<br>
> splineObj->getCellArray()->Reset();<br>
> splineObj->getCellArray()->InsertNextCell(splineObj->getPolyLine());<br>
> splineObj->getPolyData()->Modified();<br>
><br>
><br>
> Thank you,<br>
><br>
> Anant.<br>
</div></div></blockquote></div><br></div>