I find a stranger thing. I read a dicom file with vtkDICOMImageReader
, and then obtain the origin point. My code is:
img2 = vtk.vtkDICOMImageReader()
img2.SetFileName('xxx')
img2.Update()
image2 = img2.GetOutput()
print('img2: ', image2.GetOrigin())
The result is (0, 0, 0)
, but the image position (0020, 0032) is not (0, 0, 0)
.
-
I wonder whether the
vtkDICOMImageReader.GetOutput.GetOrigin
always return(0, 0, 0)
? -
In vtk 9.0.1 (python), the
vtkDICOMImageReader.GetOutput.GetDirectionMatrix
return a identify matrix even the Image Orientation (0020, 0037) is not a identfiy matrix. -
I guess that the reason why
vtkDICOMImageReader.GetOutput.GetOrigin
return(0, 0, 0)
andvtkDICOMImageReader.GetOutput.GetDirectionMatrix
return a identify matrix is that thevtkImageData
has its own coordinate system, and for this coordinate system, the origin is (0, 0, 0) and the orientation matrix is a identify matrix. Am I right? -
If I want to make the coordiante system of
vtkImageData
to be the world coordinate system, I need to adjust the origin point ofvtkDICOMImageReader.GetOutput
to Image Position (0020,0032), and the orientation ofvtkDICOMImageReader.GetOutput
to Image Orientation (0020, 0037) bySetDirectionMatrix
. Am I right?
Thank you for your suggestion!