[vtkusers] vtkImageLuminance/vtkTIFFReader WinXP vs OSX

Karl Garsha garsha at itg.uiuc.edu
Thu Nov 6 11:01:27 EST 2003


I've narrowed down the problem to vtkTIFFReader.  On Windows the scalar 
range for the image data right out of the Reader is (0.0,0.0), on the 
Mac the scalar range comes out of the Reader as (0.0,252.0).  Any 
workaround ideas are appreciated.  Thanks.
-Karl

Karl Garsha wrote:

> 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