[vtkusers] Error in opening dicom image using vtkDICOMImageReader
K O ranjith
kor1581 at gmail.com
Tue Jun 27 08:01:42 EDT 2017
Hello,
While trying to open a mri dicom image using the ReadDICOM vtk example, it
showing error in vtkDICOMImageReader. The code properly working with
sample image file supplied with the example, but showing error while supplying
other dicom images as input. The dicom image file given as input is
perfect one, I have tested it with other
dicom viewers like RadiAnt.
This is the error,
ERROR:
In C:\VTK8s\VTK-8.0.0.rc1\IO\Image\vtkDICOMImageReader.cxx, line 270
vtkDICOMImageReader(0000020DC5E9CF70): There was a problem retrieving data from:
E:/Projects/mri/evaluate/Qt/ImageViewer/VTK/VTKtest/ReadDICOM/DICOMData/image.dcm
ERROR:
In C:\VTK8s\VTK-8.0.0.rc1\Common\ExecutionModel\vtkExecutive.cxx, line 784
vtkCompositeDataPipeline
(0000020DC5E45040): Algorithm vtkDICOMImageReader(0000020DC5E9CF70) returned
failure for request: vtkInformation (0000020DC5EF8AA0)
Debug: Off
Modified Time: 2365
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FROM_OUTPUT_PORT: 0
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
And the code used is :
std::string inputFilename = "E:/mri/image.dcm";
vtkSmartPointer<vtkDICOMImageReader> reader =
vtkSmartPointer<vtkDICOMImageReader>::New();
reader->*SetFileName*(inputFilename.c_str());
reader->*Update*();
vtkSmartPointer<vtkImageViewer2> imageViewer =
vtkSmartPointer<vtkImageViewer2>::New();
imageViewer->*SetInputConnection*(reader->GetOutputPort());
vtkSmartPointer<vtkRenderWindowInteractor>renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
imageViewer->*SetupInteractor*(renderWindowInteractor);
imageViewer->*Render*();
imageViewer->*GetRenderer*()->*ResetCamera*();
imageViewer->*Render*();
renderWindowInteractor->*Start*();
Vtk version 8.0 used
Please help to sort out the error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170627/86ebbd1e/attachment.html>
More information about the vtkusers
mailing list