Patch for signed integer TIFF files (ScanImage5)

98 views
Skip to first unread message

Jack Waters

unread,
May 29, 2015, 6:28:54 PM5/29/15
to sima-...@googlegroups.com
SIMA would appear to have difficulty reading TIFF files in signed data formats. We encountered this problem when reading TIFF images acquired using ScanImage5, which are signed int16 (two's complement signed integer data). To read ScanImage5 TIFF files into SIMA, Chris Mochizuki (Allen Institute) wrote a patch (attached; Monkey_PIL.py). To use, simply import the patch (import monkey_PIL).
monkey_PIL.py

Patrick Kaifosh

unread,
Jun 1, 2015, 11:17:12 AM6/1/15
to sima-...@googlegroups.com, jackwa...@gmail.com
Thanks Jack! We don't have any ScanImage data around here, so would your group be interested in bringing this patch into SIMA and testing it out? Otherwise, we could give it a try, and then ask someone else to test.

Jack Waters

unread,
Jun 1, 2015, 2:38:37 PM6/1/15
to sima-...@googlegroups.com
Good morning Patrick,

What did you have in mind? Specifically, how might we bring the patch into SIMA?

Jack

Patrick Kaifosh

unread,
Jun 2, 2015, 4:19:55 PM6/2/15
to sima-...@googlegroups.com, jackwa...@gmail.com
Hi Jack,

I think the simplest thing would be to just add your file to the sima/misc/ directory and then try replacing

from PIL import Image

with

from sima.misc.monkey_PIL import Image

in sequences.py

Then we should just verify that everything works for both ScanImage data and other data.

Cheers,
Patrick

Jack Waters

unread,
Jun 4, 2015, 3:58:23 PM6/4/15
to sima-...@googlegroups.com
I moved monkey_Pil to the sima.misc directory and added the following as line 59 of sequences.py
from sima.misc import monkey_PIL

I then tested the code (image import, motion correction, image export) on a signed and an unsigned data set. Both worked well.

Patrick Kaifosh

unread,
Jun 4, 2015, 5:08:59 PM6/4/15
to sima-...@googlegroups.com
Great! Do you want to submit a pull request to our github project, or would you like us to just copy your description of what you did? I'd probably suggest the former if you think you might make some more contributions in the future.
--
You received this message because you are subscribed to the Google Groups "sima-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sima-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sima-users/f8b3cbfa-a673-40ff-bdd2-64475e2c0d0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages