[vtkusers] vtkJPEGReader and vtkTIFFReader

Dr. Dan White dan at chalkie.org.uk
Mon Oct 7 13:22:36 EDT 2002


Hi VTK jpeg and tiff file reader people,

I have a stack of images as .jpg or .tif files
which I want to volume render (texture map or ray trace)
When I use vtkTIFFReader or vtkJPEGReader in a python script as show 
below
no matter how I play with the opacity transfer and colour transfer 
functions
the volume rendered data looks garbled and in little rectangular 
chunks, and weird layers,
instead of the shape of a cell which am expecting.

my files are 102x119 pixels and there are 20 slices with files 
numbered 001-020.

I can't find any examples in the mailing list or example scripts
of how to use vtkTIFFReader or vtkJPEGReader properly.......

What am I doing wrong?

cheers

Dan

# Data reader
reader = vtkJPEGReader ()
reader.SetFilePrefix(filename)
reader.SetFilePattern("%s%03i.jpg")
reader.SetDataExtent(0,101,0,118,001,020)   # 1,20 works too
reader.SetDataSpacing(1,1,3)
reader.SetDataByteOrderToBigEndian      # tiff files are from PC, 
jpeg from linux, but seems to make no difference if big or little 
endian is set
#reader.SetDataMask(0x7fff) # what does this do, gives error, do I 
need it?



dan at chalkie.org.uk
http://www.chalkie.org.uk

Daniel James White PhD.
Cell Biology
Department of Biological and Environmental Science
University of Jyväskylä
FIN-40351
Jyväskylä
Finland

+358 (0)14 260 4183 (office)




More information about the vtkusers mailing list