[Image-SIG] How to quickly read a Z-axis cut of a multipage TIFF images?
Sebastian Haase
seb.haase at gmail.com
Mon Apr 12 21:10:33 CEST 2010
Joao,
could you (shortly) outline what kind of functions you could benefit
from using libtiff directly, rather than PIL (which uses raw python
for this, as
I understand).
Maybe you even show us a short example.
Another reason why I ask, is that I read that libtiff has functions
using memory mapping. So far, I have considered TIF a rather
inappropriate format for large (multi-dimensional) data because it's
not compatible to the mem-map operations I can do using numpy. (i.e. I
always have to read everything sequentially from the start)
Thanks,
Sebastian Haase
On Mon, Apr 12, 2010 at 8:09 PM, Christopher Barker
<Chris.Barker at noaa.gov> wrote:
> Joao S. O. Bueno wrote:
>>
>> I once implementd a Tiff reader in C using libtiff, and it was not hard to
>> do - maybe you should try and move part of your processing to C , and
>> implement some Python itnerface that would allow you to drive everything
>> with simpler scripting.
>> (For example, you could have a libtiff C function that would create you an
>> Y-Z slice of your data, and return that as a 2d array to python)
>
> If you go this route, I'd strongly recommend using Cython, or maybe ctypes
> for the bindings.
>
> -Chris
>
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> 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
> _______________________________________________
> Image-SIG maillist - Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
More information about the Image-SIG
mailing list