[vtkusers] (no subject)
nadine kempe
n.kempe at gmx.net
Thu Nov 1 19:45:22 EDT 2007
Hello @ all,
I am a beginner with VTK and have a, from my point of view, strange problem, maybe it es very easy and somebody could give me a hint for a solution (I programm in C++ on OpenSuSE 10.2):
I work on a tool for vizualisation of medical images (SPECT), within this tool, there are 3 RenderWidgets which show me the three different views on the human body through which I can scroll slice by slice. Now I want to mark certain points in these Widgets by their coordinates.
The Problems is, the points appear on 2 or 3 slices around the coordinates, I gave them. So I see something like a little cross in 3D, not only one point (I hope you can follow my explanation).
I tried the following code:
vtkPoints *points = vtkPoints::New();
points->InsertPoint(1, 50 ,28 ,31); //example point
//I read somewhere, that vtkPolydata needs both, Points and CellArray
vtkCellArray *cellArray = vtkCellArray::New();
cellArray->InsertNextCell(0);
cellArray->InsertCellPoint(pointCount);
cellArray->UpdateCellCount(pointCount);
vtkPolyData *polyData = vtkPolyData::New();
polyData->SetVerts(cellArray);
polyData->SetPoints(points);
vtkPolyDataMapper *polyDataMapper = vtkPolyDataMapper::New();
polyDataMapper->SetInput(polyData);
vtkActor *actor = vtkActor::New();
actor->SetMapper(polyDataMapper);
actor->GetProperty()->SetColor(0,0,0);
actor->GetProperty()->SetPointSize(2);
this->RenderWidgetNW->RenderWidget->AddOverlayViewProp(actor);
this->RenderWidgetNW->UpdateContent();
(RenderWidgetNW is an instance of my own class MyRenderWidget which has a member named RenderWidget of the type vtkKWRenderWidget. This class is part of the KWWidgets-toolkit which is based on VTK).
I tried different modifications on the code above without sucess.
I would be very gratefull,if somebody could help me!
Thanks a lot and have a nice day,
Nadine
--
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