[vtkusers] How to open a series of Dicom image?
kmd1995
kmd1995 at sjtu.edu.cn
Wed Jul 22 23:04:47 EDT 2015
Hi all,
I have a series of Dicom image, and I want to open them with
vtkDICOMImageReader. I've tried lots of
ways, including SetdirectoryName (which worked fine on earlier dicom images)
,using vtkImageAppend.
When using SetdirectoryName, the extend is always(0,511,0,511,0,0) but it
should be ((0,511,0,511,0,67)).
When using vtkImageAppend, I got image of right size but all zero,(i.e.
when I call GetScalarComponentAsDouble it returns zero whatever the position
of picture).
Besides,when I do this
data.SetScalarComponentFromDouble(32,34,2,0,0.5)
print data.GetScalarComponentAsDouble(32,34,2,0)
why I get 0.0?
I'm totally comfused.Looking forward for any help.Thx!
And my code
v16 = vtk.vtkDICOMImageReader()
append=vtk.vtkImageAppend()
append.SetAppendAxis(2)
readers=[0]*67
for i in range (67):
x="F:\\SE2\\IM%d" %i
readers[i]=vtk.vtkDICOMImageReader()
readers[i].SetDataSpacing(1,0.8,1.2)
readers[i].SetFileName(x)
append.SetInputConnection(readers[i].GetOutputPort())
append.Update()
print append.GetOutput().GetExtent()
--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-open-a-series-of-Dicom-image-tp5733056.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list