[Image-SIG] How to quickly read a Z-axis cut of a multipage TIFF images?

Christopher Barker Chris.Barker at noaa.gov
Mon Apr 12 18:34:18 CEST 2010

Yury V. Zaytsev wrote:
>> Therefore I'd like to inquire whether this is an issue with PIL, or
>> underlying TIFF reader, or maybe there's a built-in method to quickly
>> read Z-axis cut that I didn't consider (I'm a total PIL n00b).

I"m not sure I quite follow what you need to do, but in general, doing 
things one pixel, or line, or... at a time is going to be slow in 
Python. You can't hold it all in memory, but maybe you could work with a 
bunch of frames at a time -- as many as you can hold in memory?

> As a follow-up I have got another idea (which I would be quite reluctant
> to implement though) on how to dramatically speed up things, that is to
> convert the image to an uncompressed binary format which would allow
> random seeking (given that the resolution is known and so is the number
> of bytes per pixel). 

Maybe you could load it all into a numpy memory mapped array, and then 
work with it there? Or maybe hdf5, via PyTables or H5Py.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the Image-SIG mailing list