[Dcmlib] vtk/viewer.cxx

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Fri Oct 3 14:42:08 CEST 2003


Salut,

	Je voudrais commiter un autre ex:

Un code du style:

////////////////////////////////////////////////////////////
#include "vtkRenderWindowInteractor.h"
#include "vtkImageViewer2.h"
#include "vtkStructuredPoints.h"

#include "vtkGdcmReader.h"

int main(int argc, char *argv[])
{

   vtkGdcmReader *reader = vtkGdcmReader::New();
   reader->SetFileName( argv[1] );

   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();

   vtkImageViewer2 *viewer = vtkImageViewer2::New();
   viewer->SetInput ( reader->GetOutput() );
   viewer->SetupInteractor (iren);

   iren->Initialize();
   iren->Start();

   reader->Delete();
   iren->Delete();
   viewer->Delete();

   return 0;
}
////////////////////////////////////////////////////////////

Ca permet d'afficher rapidement une image, via VTK.

Commentaires/suggestions
mathieu




More information about the Dcmlib mailing list