[vtkusers] vtkJPEGReader and vtkTIFFReader

anast.jm at pg.com anast.jm at pg.com
Mon Oct 7 14:23:57 EDT 2002


I suspect these are color images and you might want to try to extract the
luminance (vtkImageLuminance) before rendering....john


                                                                
 Internet Mail Message                                          
 Received from host:      public.kitware.com                    
 [24.97.130.19]                                                 
                                                                


From: "Dr. Dan White" <dan at chalkie.org.uk>@public.kitware.com on 10/07/2002
08:22 PM ZE3
                                                                                              
    "Dr. Dan White" <dan at chalkie.org.uk>           To:   vtkusers at public.kitware.com          
                     @public.kitware.com           Cc:    (bcc: John Anast-JM/PGI)            
                                           Subject:      [vtkusers] vtkJPEGReader and         
                                                vtkTIFFReader                                 
                                Sent by:                                                      
       vtkusers-admin at public.kitware.com                                                      
                     10/07/2002 01:22 PM                                                      
                                                                                              
                                                                                              




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)

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers






More information about the vtkusers mailing list