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

ImageSequenceND is not working #48

Open
tikkita opened this issue Nov 9, 2018 · 4 comments
Open

ImageSequenceND is not working #48

tikkita opened this issue Nov 9, 2018 · 4 comments

Comments

@tikkita
Copy link

tikkita commented Nov 9, 2018

Hi, I am pretty new to python. I was trying to use 3d tracking for my stack of images which are as z and t index separated png files, then made a .zip file to use the ImageSequenceND. But no matter what I do I always get the "index is out of bounds" error. I am unable to understand the problem after so many attempts and would really appreciate the help. Here is what I tried, and the output I get.


IndexError Traceback (most recent call last)
in ()
----> 1 images=pims.ImageSequenceND('./tiffstacks.zip',axes_identifiers = ['z', 't'])

~/anaconda3/lib/python3.6/site-packages/pims/image_sequence.py in init(self, path_spec, process_func, dtype, as_grey, plugin, axes_identifiers)
430 self.axes_identifiers = axes_identifiers
431 ImageSequence.init(self, path_spec, process_func,
--> 432 dtype, as_grey, plugin)
433 shape = self._first_frame_shape
434 if len(shape) == 2:

~/anaconda3/lib/python3.6/site-packages/pims/image_sequence.py in init(self, path_spec, process_func, dtype, as_grey, plugin)
93 self._is_zipfile = False
94 self._zipfile = None
---> 95 self._get_files(path_spec)
96
97 tmp = self.imread(self._filepaths[0], **self.kwargs)

~/anaconda3/lib/python3.6/site-packages/pims/image_sequence.py in _get_files(self, path_spec)
468 for f in self._filepaths])
469 for n, name in enumerate(self.axes_identifiers):
--> 470 if np.all(self._toc[:, n] == 0):
471 self._toc = np.delete(self._toc, n, axis=1)
472 else:

IndexError: index 1 is out of bounds for axis 1 with size 1

@nkeim
Copy link
Contributor

nkeim commented Nov 9, 2018 via email

@tikkita
Copy link
Author

tikkita commented Nov 12, 2018

Thanks for the reply. And no, I tried that as well. Didn't work, and I got the same IndexError ( index 1 is out of bounds for axis 1 with size 1).

@nkeim
Copy link
Contributor

nkeim commented Nov 13, 2018

Thanks. We are quickly getting out of my depth (and into that of @caspervdw ), but have you confirmed that you are able to read all the images in a single tiff stack?

@tikkita
Copy link
Author

tikkita commented Nov 15, 2018

Hi, the ImageSequenceND doesn't work (index out of bound error).

  1. Currently i am using -
    from skimage import io
    im = io.imread('file.tif')

This gives me a four dimensional array and I am individually tracking features in each 2d plane (by treating each plane as a matrix element) then stacking them in 3d, but its not very efficient.

  1. Another way I have tried is pims.TiffStack, this gives me a single file with n number of frames and no separation in z and t.
    Length: 374 frames
    Frame Shape: 2048 x 2048
    Pixel Datatype: uint16
    in this case however, the frames[123].metadata tells me {'ImageDescription': 'ImageJ=1.51u\nimages=374\nslices=34\nframes=11\nhyperstack=true\nunit=inch\nloop=false\nmin=4276.0\nmax=65535.0\n'}, here, nslices=34\nframes=11 represents my z and t slices if I understand correctly. But again, I am unable to figure out how to use this information.

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

2 participants