soft-matter / trackpy-examples

sample images, examples, and speed tests for trackpy
Other
21 stars 42 forks source link

3D tracking tutorial: problem loading zipfile stack #37

Open nkeim opened 8 years ago

nkeim commented 8 years ago

When I launch the 3D tracking example in Binder, running the 2nd cell (the one that loads the image stack) raises

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-5046be688d14> in <module>()
----> 1 frames = pims.ImageSequenceND(r'../sample_data/pmma_colloids.zip', axes_identifiers = ['z', 't'])
      2 frames.bundle_axes = ['z', 'y', 'x']
      3 frames.iter_axes = 't'
      4 frames

/home/main/anaconda/envs/binder/lib/python3.4/site-packages/pims/image_sequence.py in __init__(self, path_spec, process_func, dtype, as_grey, plugin, axes_identifiers)
    297         self.axes_identifiers = axes_identifiers
    298         super(ImageSequenceND, self).__init__(path_spec, process_func,
--> 299                                               dtype, as_grey, plugin)
    300         shape = self._first_frame_shape
    301         if len(shape) == 2:

/home/main/anaconda/envs/binder/lib/python3.4/site-packages/pims/image_sequence.py in __init__(self, path_spec, process_func, dtype, as_grey, plugin)
     93         self._get_files(path_spec)
     94 
---> 95         tmp = self.imread(self._filepaths[0], **self.kwargs)
     96         self._first_frame_shape = tmp.shape
     97 

/home/main/anaconda/envs/binder/lib/python3.4/site-packages/pims/image_sequence.py in imread(self, filename, **kwargs)
    118                               "scipy, matplotlib or scikit-image.")
    119         if self._is_zipfile:
--> 120             file_handle = StringIO(self._zipfile.read(filename))
    121             return imread(file_handle, **kwargs)
    122         else:

TypeError: initial_value must be str or None, not bytes
danielballan commented 8 years ago

This is a Python 3 issue. I discovered the same thing when overhauling trackpy-examples in the py3 env. (Happily, no other notebooks revealed py3 issues in our packages.) I fixed it here: https://github.com/soft-matter/pims/pull/199 but the last release of pims doesn't have the fix.

Seems like we need slicerator and pims releases pretty soon. Any other blockers?

caspervdw commented 8 years ago

What do you mean by blockers?

I wanted to have a good look at plot_to_frame and circumvent PIL mainly to increase performance and also to solve the 3.0.0 incompatibility issue.

2015-11-24 16:22 GMT+01:00 Dan Allan notifications@github.com:

This is a Python 3 issue. I discovered the same thing when overhauling trackpy-examples in the py3 env. (Happily, no other notebooks revealed py3 issues in our packages.) I fixed it here: soft-matter/pims#199 https://github.com/soft-matter/pims/pull/199 but the last release of pims doesn't have the fix.

Seems like we need slicerator and pims releases pretty soon. Any other blockers?

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/37#issuecomment-159302847 .

danielballan commented 8 years ago

What do you mean by blockers?

I meant issues/PRs to close before we tag a bug-fix release. I'm fine waiting for plot_to_frame to be ready.