[vtkusers] Recalculation of contours into an contour representation

Sven Olaf Lüttmann sven.luettmann at fh-dortmund.de
Fri Nov 25 05:41:41 EST 2011


Hey Marcelino,
thanks for your hint to vtkCutter.

I was looking around a bit and found an example 
what is implemting vtkCutter and vtkSplitter and 
is pretty much doing what I want to achieve. ( 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractPolyLinesFromPolyData 
)

Unfortunately its not working in my case, I always 
got zero zero lines from either the vtkCutter or 
the vtkStripper.
Here is my sample code:

vtkSmartPointer< vtkPlane > plane = 
vtkSmartPointer<vtkPlane>::New();

     vtkSmartPointer< vtkCutter > cutter = 
vtkSmartPointer<vtkCutter>::New();
     cutter->SetInput( contourModel );
     cutter->SetCutFunction( plane );
    //  cutter->GenerateValues( 10 , -.5, .5 ); 
Parameters from example
     cutter->GenerateValues( 
contourModel->GetNumberOfLines() , 
contourModel->GetScalarRange()[0], 
contourModel->GetScalarRange()[1] );

     vtkSmartPointer< vtkStripper > stripper = 
vtkSmartPointer<vtkStripper>::New();
     stripper->SetInput( cutter->GetOutput() );

I don't understand what the function 
GenerateValues does and what the parameters mean.
Does anybody can give me an explanation of this 
function or has any further hints what to do?

Thanks in advance .
  Sven

On 24.11.2011 17:52, Marcelino Rodriguez Cancio 
wrote:
> Sven,
>
> Why dont you try with a vtkCutter to extract your slice? Take a look at the vtkCutter test:
>
> /Graphics/Testing/Tcl/probe.tcl
>
> Cheers
> Marcelino
>
> -----Mensaje original-----
> De: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] En nombre de Sven Olaf Lüttmann
> Enviado el: jueves, 24 de noviembre de 2011 11:31 a.m.
> Para: vtkusers
> Asunto: [vtkusers] Recalculation of contours into an contour representation
>
> Dear vtk users,
> I have a question gerading contours in a
> vtkContourRepresentation.
>
> What I have is a deformed model as vtkPolyData,
> representing an anatomical structure, and a
> corresponding volume dataset (MR-Images).
>
> Now I'd like to recalculate a contour from the
> model of a specific slice in the dataset and pass
> it back to a vtkContourWidget to readjust it again.
>
> Therefore I iterate through all points in my
> vtkPolyData model and compare the z coordinate of
> the point with that from the slice. That is
> already working.
> I saw that I can add Points to a contour
> representation by calling
> AddNodeAtWorldPosition(), for example.
>
> Unfortunately that is not working as expected.
>
> Does someone has an idea how to achieve that, is
> there a better way to extract single contours from
> an vtkPolyData model and add them to a contour widget.
>
> Thanks very much for your help
>    Sven
> _______________________________________________
> 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
>
> -Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
> -Participe en Universidad 2012, del 13 al 17 de febrero de 2012. Habana.Cuba.  http://www.congresouniversidad.cu
> -Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu/
>
>
>
> -Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
> -Participe en Universidad 2012, del 13 al 17 de febrero de 2012. Habana.Cuba.  http://www.congresouniversidad.cu
> -Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu/
>
>




More information about the vtkusers mailing list