[vtkusers] vtkImageViewer Problems
nadine kempe
n.kempe at gmx.net
Mon Nov 5 17:59:37 EST 2007
Hello,
I work on a software to display and analyse 3D medical images. there for I use three vtkKWRenderWidget, each of them shows me one orthogonal view of the data and allows me to scroll through the slices. I use the vtkImageViewer to display the actual slices.
So far, everything works fine. But now I want to display geometrie (points, lines...) in these images. So I create the points for the lines, pack them into a mapper and into an actor. then I add the actor to the rendere - but what I see is every part of the geometry which lies in front of the current slice - not only the part which is located in the current slice (whith the image data everything works fine, I only see the data in the current slice).
Can somebody maybe tell me, why vtkImageViewer behaves like this? And how I can change it, to make the behavior it shows with geometry the same like with the data?
Hers is a part of my code, just if somebody wants to have a look:
vtkPoints * pts = vtkPoints::New();
pts->InsertPoint( 0, 30, 30, 30 );
pts->InsertPoint( 1, 50, 50, 50 );
vtkCellArray * line = vtkCellArray::New();
line->InsertNextCell(2);
line->InsertCellPoint(0);
line->InsertCellPoint(1);
vtkPolyData * polyLine = vtkPolyData::New();
polyLine->SetPoints(pts);
polyLine->SetLines( line );
vtkPolyDataMapper *polyLineDataMapper = vtkPolyDataMapper::New();
polyLineDataMapper->SetInput(polyLine);
vtkActor *Lineactor = vtkActor::New();
Lineactor->SetMapper(polyLineDataMapper);
Lineactor->GetProperty()->SetColor(0,0,0);
Lineactor->GetProperty()->SetLineWidth(5);
Lineactor->GetProperty()->SetPointSize(5);
this->RenderWidgetNW->ImageViewer->GetRenderer()->AddActor(Lineactor);
thanks a lot!
Nadine
(sorry for the other mail without content, I did not want to send it)
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
More information about the vtkusers
mailing list