[vtkusers] how to read dicom file using python?

RimAY rim.ayari at gmail.com
Tue Feb 17 06:23:14 EST 2009


I'm sorry,
Thanks for your reply,

Here is my code:

import vtk 

reader = vtk.vtkDICOMImageReader()
reader.SetDirectoryName('the root of my dicom files')
win = 400000
lev = 400000

viewer = vtk.vtkImageViewer()
viewer.SetInputConnection( reader.GetOutputPort() )
viewer.SetColorWindow(win)
viewer.SetColorLevel(lev)
viewer.Render()

viewer2 = vtk.vtkImageViewer2()
viewer2.SetInputConnection( reader.GetOutputPort() )
viewer2.SetColorWindow(win)
viewer2.SetColorLevel(lev)
viewer2.Render()

iren = vtk.vtkRenderWindowInteractor()
viewer2.SetupInteractor(iren)
iren.Initialize()

and I got the following error:: vtkDICOMImageReader[015579F0]: Couldn't get
stored files.

Please could someone help me to resolve it
Thanks a lot

malat wrote:
> 
> On Tue, Feb 17, 2009 at 11:30 AM, RimAY <rim.ayari at gmail.com> wrote:
>>
>> Hi all,
>> I'm trying to read a Dicom file using python. I have successfully built
>> VTK_5.2.1 in python 2.4, but I failed to use vtkDICOMImageReader(). I got
>> many errors .
> 
> Do you really expect anyone to help you out without:
> 1. Sending the actual error
> 2. Sending the actual code you were using
> 
> 
> 
> -- 
> Mathieu
> _______________________________________________
> 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
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-read-dicom-file-using-python--tp22054451p22055230.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list