[vtkusers] vtkImageLuminance/vtkTIFFReader WinXP vs OSX
Karl Garsha
garsha at itg.uiuc.edu
Thu Nov 6 10:52:13 EST 2003
Greetings,
I'm experiencing anomolous behavior when trying to read 8-bit greyscale
images on Windows with the Python wrappers. The code I'm using follows:
Reader=vtk.vtkTIFFReader()
Reader.SetFileName('test.tif')
Reader.Update()
LUM=vtk.vtkImageLuminance()
LUM.SetInput(Reader.GetOutput())
LUM.Update()
ImageData1=LUM.GetOutput()
ImageData1.GetNumberOfScalarComponents()
#***Result on WinXP
1
#***Result on OSX
1
ImageData1.GetScalarRange()
#***Result on WinXP
(0.0,0.0)
#***Result on OSX
(2.0, 251.0) # This is the answer I expect
Does anyone have some ideas about how I can go about reading 8-bit B&W
or color indexed images in a cross platform manner? I'm running
Python2.3, wxWindows and VTK 4.2 on both machines (although I was lazy
and just downloaded the Enthought Edition of SciPy 2.3 for Windows--my
mac has everything up to date from CVS). Is vtkImageLuminance or
vtkTIFFReader known to behave differently on Windows? vtkTIFFReader
works fine if the image is converted to RGB greyscale in other software
before reading, but that is a cumbersome approach. Thanks in advance
for any insights.
Best,
Karl
--
Karl Garsha
Light Microscopy Specialist
Imaging Technology Group
Beckman Institute for Advanced Science and Technology
University of Illinois at Urbana-Champaign
405 North Mathews Avenue
Urbana, IL 61801
Office: B650J
Phone: 217.244.6292
Fax: 217.244.6219
Mobile: 217.390.1874
www.itg.uiuc.edu
More information about the vtkusers
mailing list