[vtkusers] How to cut and flat a volumedata with an spline

Raúl Ferriz raul at torresyvalero.com
Mon Oct 25 05:11:28 EDT 2010


El 22/10/2010 12:36, Raúl Ferriz escribió:
> Hello users,
> I have this code:
>
>         line_sup = vtkPolyData::New();
>
>         this->m_LineaSP->GetPolyData ( line_sup );
>
>         // Create second spline 30 units down
>         trans = vtkTransform::New();
>         trans->Translate ( 0.0, 0.0, -30.0 );
>
>         transFilter = vtkTransformPolyDataFilter::New();
>         transFilter->SetInput ( line_sup );
>         transFilter->SetTransform ( trans );
>         transFilter->Update ();
>
>         // Merge two lines on one polydata
>         vtkAppendPolyData * mergedPolyData = vtkAppendPolyData::New();
>         mergedPolyData->AddInput ( line_sup );
>         mergedPolyData->AddInputConnection ( 
> transFilter->GetOutputPort () );
>         mergedPolyData->Update();
>
>         // Create ruled surface
>         vtkRuledSurfaceFilter * surface = vtkRuledSurfaceFilter::New();
>         surface->SetInputConnection ( mergedPolyData->GetOutputPort() );
>         surface->SetOffset ( 0 );
>         surface->SetOnRatio ( 2 );
>         surface->PassLinesOn ();
>         surface->SetRuledModeToResample ();
>         surface->SetDistanceFactor ( 60.0 );
>
>         vtkProbeFilter * probe = vtkProbeFilter::New();
>         probe->SetSource ( imageData );
>         probe->SetInputConnection ( surface->GetOutputPort () ) ;
>         probe->Update();
>
>
> This seems to work, but at probe filter, 
> vtkImageData::SafeDowncast(probe->GetOutput()) allways return NULL, if 
> I don't safedowncast, object returned seems to have 0 valid points. I 
> had checked bounding boxes of mergedPolyData and imageData and they 
> intersects, so I can assume that surface is working properly. Am I 
> doing something wrong ?
> _______________________________________________
> 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
No one can give an advise? :-(



More information about the vtkusers mailing list