[vtkusers] Error in vtkImageChangeInformation
Matthias Zangl
zangl at ism-austria.at
Fri Jun 8 07:09:09 EDT 2001
Hello!
I have already posted some mails concerning a problem
with vtkImageReslice. I am reading some slices of an
object from TIF-files.
And I can view these slices with a vtkImageViewer. But
I have to make slices not only along the Z but also
along the X and Y axis. And it should be possible to
create free slices through a given point and along
free angles around every axis.
But when I do that I only get an empty screen.
And I suppose that I am turning the object around
(0,0,0) and not the center of the image.
So I got the message from the mailinglist that I
should move the object to (0,0,0) and then turn it.
But this doesn't work.
I found in the header of vtkImageReslice a hint that I
should use vtkImageChangeInformation to put the origin
to the center of my object.
This resulted in following error messages:
ERROR: In
c:\vtk\imaging\vtkImageChangeInformation.cxx, line 265
vtkImageChangeInformation (0083A620): Bug in code.
ERROR: In c:\vtk\common\vtkDataObject.cxx, line 558
vtkImageData (00892578): Update extent does not lie
within whole extent
ERROR: In c:\vtk\common\vtkDataObject.cxx, line 565
vtkImageData (00892578): Update extent is: 8542804,
255, 1244212, 12011562, 1244264, 1244240
ERROR: In c:\vtk\common\vtkDataObject.cxx, line 572
vtkImageData (00892578): Whole extent is: 0, 255, 0,
255, 0, 119
ERROR: In
c:\vtk\imaging\vtkImageChangeInformation.cxx, line 216
vtkImageChangeInformation (0083A620): Bug in code.
ERROR: In c:\vtk\common\vtkImageData.cxx, line 1488
vtkImageData (00825A28): GetScalarPointer: Pixel (0,
0, 0) not in memory.
Current extent= (0, -1, 0, -1, 0, -1)
So I tried an example from VTK (RotateImage.py) which
resulted in the same error messages and terminated
with an access violation.
These error messages just occur when I use the
vtkImageChangeInformation, which is my last hope to
get my slices through my ImageData object.
I also send you my python script:
# from string import *
from libVTKCommonPython import *
from libVTKGraphicsPython import *
from WindowLevelInterface import *
# Image Reader
reader = vtkTIFFReader()
reader.SetFilePrefix("C:\\source\\dicoms\\daten\\bud\\raw\\i.")
reader.SetFilePattern("%s%.3d.tif")
reader.SetDataExtent(0,512,0,512,1,120)
reader.Update()
center = vtkImageChangeInformation()
center.SetInput(reader.GetOutput())
center.SetCenterImage(1)
transform = vtkTransform()
transform.RotateX(90)
reslice = vtkImageReslice()
reslice.SetInput(center.GetOutput())
reslice.SetResliceTransform(transform)
reslice.SetInterpolationModeToLinear()
reslice.Update()
viewer = vtkImageViewer()
viewer.SetInput(reslice.GetOutput())
viewer.SetColorWindow(256)
viewer.SetColorLevel(127.5)
viewer.SetZSlice(0)
viewer.Render()
#make interface
WindowLevelInterface(viewer)
Thank you in advance.
Bye, Matthias
ps.: I am using the nightly build from yesterday!
More information about the vtkusers
mailing list