Error in opening dicom image using vtkDICOMImageReader

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error in opening dicom image using vtkDICOMImageReader

K O ranjith


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


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in opening dicom image using vtkDICOMImageReader

Liu_tj
You can post a request to David Gobbi for his vtkDicomReader.


在2017-06-29,"K O ranjith" <[hidden email]> 写道:
-----原始邮件-----
发件人:"K O ranjith" <[hidden email]>
发送时间:2017年06月29日 星期四
收件人:"Liu_tj" <[hidden email]>
主题:Re: [vtkusers] Error in opening dicom image using vtkDICOMImageReader

Thanks for the solution..
It's working. one difference noted between vtkDICOMImageReader vs vtkDICOMReader is,  vtkDICOMImageReader set the window level & window width from the dicom metadata properly.
But in case of vtkDICOMImageReader, have to manually set....

On Tue, Jun 27, 2017 at 7:13 PM, Liu_tj <[hidden email]> wrote:
Actually vtkDICOMImageReader might fail to parse some DICOM files. As we know, current vtkDICOMImageReader
version does not follow the complete DICOM standard. Maybe you can try vtkDICOMReader by David Gobbi.


在2017-06-27,"K O ranjith" <[hidden email]> 写道:
-----原始邮件-----
发件人:"K O ranjith" <[hidden email]>
发送时间:2017年06月27日 星期二
收件人:"vtkusers" <[hidden email]>
主题:[vtkusers] Error in opening dicom image using vtkDICOMImageReader



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



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in opening dicom image using vtkDICOMImageReader

xmariadoss
This post has NOT been accepted by the mailing list yet.
In reply to this post by K O ranjith
`Hi ,


 Please read the dicom image like this .

vtkDICOMImageReader reader = new vtkDICOMImageReader();
        reader.SetDirectoryName(path);
        reader.SetDataScalarTypeToUnsignedShort();
        reader.UpdateWholeExtent();
        reader.Update();

Thank u.
Loading...