Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

construct a MultiPageTIFF: Error #212

Open
ObadaM opened this issue May 31, 2016 · 3 comments
Open

construct a MultiPageTIFF: Error #212

ObadaM opened this issue May 31, 2016 · 3 comments

Comments

@ObadaM
Copy link

ObadaM commented May 31, 2016

I am getting an error when I apply the following code:

files = glob.glob('data/*.tif')
sequences = [sima.Sequence.join(*[sima.Sequence.create('TIFF', tif_file) ]) for tif_file in files]

Error

Traceback (most recent call last):
  File "/home/l-01-314/PycharmProjects/test/Motion_Correction.py", line 32, in <module>
    sequences = [sima.Sequence.join(*[sima.Sequence.create('TIFF', folder) ]) for folder in pop]
  File "/home/l-01-314/PycharmProjects/test/Motion_Correction.py", line 32, in <listcomp>
    sequences = [sima.Sequence.join(*[sima.Sequence.create('TIFF', folder) ]) for folder in pop]
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 245, in join
    return _Joined_Sequence(sequences)
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 748, in __init__
    shape = seq.shape[:-1]
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 167, in shape
    return (len(self),) + self._get_frame(0).shape
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 558, in __len__
    self._len = sum(1 for _ in self)
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 558, in <genexpr>
    self._len = sum(1 for _ in self)
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 509, in __iter__
    for _ in range(self._num_planes)], 0)
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 509, in <listcomp>
    for _ in range(self._num_planes)], 0)
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 507, in <listcomp>
    for _ in range(self._num_channels)],
  File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 536, in _iter_pages
    images.seek(idx)
  File "/usr/anaconda3/lib/python3.5/site-packages/PIL/TiffImagePlugin.py", line 934, in seek
    self.im = Image.core.new(self.mode, self.size)
ValueError: unrecognized mode

is there any idea why I am getting this error ?

@nbdanielson
Copy link
Contributor

Can you try installing version 1.3.0 to make sure this isn't an issue with
the version we just released?

On Tue, May 31, 2016 at 11:56 AM, ObadaM [email protected] wrote:

I am getting an error when I apply the following code:

files = glob.glob('data/.tif')
sequences = [sima.Sequence.join(
[sima.Sequence.create('TIFF', tif_file) ]) for tif_file in files]

Error

Traceback (most recent call last):
File "/home/l-01-314/PycharmProjects/test/Motion_Correction.py", line 32, in
sequences = [sima.Sequence.join([sima.Sequence.create('TIFF', folder) ]) for folder in pop]
File "/home/l-01-314/PycharmProjects/test/Motion_Correction.py", line 32, in
sequences = [sima.Sequence.join(
[sima.Sequence.create('TIFF', folder) ]) for folder in pop]
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 245, in join
return _Joined_Sequence(sequences)
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 748, in init
shape = seq.shape[:-1]
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 167, in shape
return (len(self),) + self._get_frame(0).shape
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 558, in len
self._len = sum(1 for _ in self)
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 558, in
self._len = sum(1 for _ in self)
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 509, in iter
for _ in range(self._num_planes)], 0)
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 509, in
for _ in range(self._num_planes)], 0)
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 507, in
for _ in range(self._num_channels)],
File "/usr/anaconda3/lib/python3.5/site-packages/sima-1.3.1-py3.5-linux-x86_64.egg/sima/sequence.py", line 536, in _iter_pages
images.seek(idx)
File "/usr/anaconda3/lib/python3.5/site-packages/PIL/TiffImagePlugin.py", line 934, in seek
self.im = Image.core.new(self.mode, self.size)
ValueError: unrecognized mode

is there any idea why I am getting this error ?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#212, or mute the thread
https://github.com/notifications/unsubscribe/AH9T4pLfiU-caXx672DqQvnCHLcuiYnzks5qHFovgaJpZM4Iqr13
.

@ObadaM
Copy link
Author

ObadaM commented Jun 2, 2016

@nbdanielson
I run this command to install the previous version:

pip install sima==1.3.0

But I could not install it, I got the following:

Building wheels for collected packages: sima
  Running setup.py bdist_wheel for sima ... error
  Complete output from command /usr/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-m3nq4i26/sima/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp6jvwikj1pip-wheel- --python-tag cp35:
.
.
.
.
 ----------------------------------------
  Failed building wheel for sima
  Running setup.py clean for sima
Failed to build sima
Installing collected packages: sima
  Running setup.py install for sima ... error
    Complete output from command /usr/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-m3nq4i26/sima/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-qhx0bibj-record/install-record.txt --single-version-externally-managed --compile:
.
.
.
.
    ----------------------------------------
Command "/usr/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-m3nq4i26/sima/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-qhx0bibj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-m3nq4i26/sima/

@pkaifosh
Copy link
Member

pkaifosh commented Jul 2, 2016

Can you please confirm the format of your data, i.e. what is contained in each TIFF file?
Do you have PIL or pillow installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants