[vtkusers] Multiple Image in one screen ((Dicom images))
Hellice
saouli-abdelhak at hotmail.com
Fri Mar 23 16:50:28 EDT 2012
Hi
The vtk is realy big and am jumping here and there try to get out with
somthing useful;
I am now trying to display Dicom images on 2D in one windows
It's simple :
1- I created An array of actors withe max 200
2- read my set of data Dicom with vtkdicomimagereader
3-mappe it on mapper with vtkimagemapper
4- for eache slice iset the position of an actor than i set this actor withe
the mapper data ((Act[slicenumb]->setMapper(MapImag) )) and befor that i did
MapImage->Setzslice(slicenumb)]
5- Update the mapper and add eache actore to the render
6- do the usuale stuff to render every thing
The probleme is the actors i created get only the laste slice imageand i get
window with one image Duplicate Number of slice time Like that
http://vtk.1045678.n5.nabble.com/file/n5590677/Untitled_5.jpg
and i dont want that
here is my mane
*******************************************
*
int main()
{
vtkActor2D *Actors[500];
vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
vtkImageActor *viewer = vtkImageActor::New();
reader->SetDirectoryName("Data1");
reader->Update();
vtkImageResample *resiz = vtkImageResample::New();
resiz->SetInputConnection(reader->GetOutputPort());
resiz->SetAxisMagnificationFactor(0,0.3);
resiz->SetAxisMagnificationFactor(1,0.3);
vtkImageMapper *ImageMap = vtkImageMapper::New();
ImageMap->SetInputConnection(resiz->GetOutputPort());
vtkRenderer *ren1= vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
int slices = ImageMap->GetWholeZMax();
Actors[0] = vtkActor2D::New();
Actors[0]->SetMapper(ImageMap);
ren1->AddActor2D(Actors[0]);
renWin->AddRenderer( ren1 );
for(int i=1;i<slices;i++)
{
ImageMap->SetZSlice(i);
Actors[i] = vtkActor2D::New();
Actors[i]->SetPosition(Actors[i-1]->GetPosition()[0]+65,Actors[i-1]->GetPosition()[1]);
if(Actors[i]->GetPosition()[0]>=600)
{
Actors[i]->SetPosition(0,Actors[i-1]->GetPosition()[1]+65);
}
Actors[i]->SetMapper(ImageMap);
ImageMap->Update();
ren1->AddActor2D(Actors[i]);
renWin->AddRenderer( ren1 );
}
ren1->SetBackground( 0.1, 0.2, 0.4 );
renWin->SetSize( 600, 600 );
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
iren->Initialize();
iren->Start();
}
*
And also the intractore does nothing bcoze this is importan to any medicale
softeware
--
View this message in context: http://vtk.1045678.n5.nabble.com/Multiple-Image-in-one-screen-Dicom-images-tp5590677p5590677.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list