[vtkusers] display DICOM image
Massi
Massinissa.Bandou at USherbrooke.ca
Wed May 30 13:42:52 EDT 2012
Hi
I'm trying to read a series of DICOM images (60 images) from file and
display them in a Qt GUI using QVTKWidget. I wrote a simple code:
vtkSmartPointer<vtkDICOMImageReader> reader =
vtkSmartPointer<vtkDICOMImageReader>::New();
reader->SetDirectoryName(DICOMImage);
reader->Update();
vtkImageMapper *imageMapper =vtkImageMapper::New();
imageMapper->SetInput(reader->GetOutput());
imageMapper->GetInput();
vtkImageActor *mapActor= vtkImageActor::New();
mapActor->SetInput(imageMapper->GetInput());
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
renderer->AddActor(mapActor);
widget.qvtkWidget->GetRenderWindow()->AddRenderer(renderer);
widget.qvtkWidget->update();
But I got 2 errors:
ERROR: In c:/Users/Massi/Downloads/VTK/IO/vtkDICOMImageReader.cxx, line 346
vtkDICOMImageReader (0x7a70b48): There was a problem retrieving data from:
C:/Users/Massi/Downloads/PNEUMATIX/Cardiovascular Heart-Cardiac
Function/fl3d-cor//IM-0001-0001.dcm
ERROR: In c:/Users/Massi/Downloads/VTK/Rendering/vtkImageActor.cxx, line 266
vtkOpenGLImageActor (0xd1ebb98): This filter requires unsigned char scalars
as input
how can I fix this problem?
thank you for your help!
Massi
--
View this message in context: http://vtk.1045678.n5.nabble.com/display-DICOM-image-tp5713500.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list