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

loading 3D .tiff files #11

Open
crypdick opened this issue Aug 8, 2018 · 1 comment
Open

loading 3D .tiff files #11

crypdick opened this issue Aug 8, 2018 · 1 comment

Comments

@crypdick
Copy link

crypdick commented Aug 8, 2018

I have image stacks which I am trying to load into pytiff. However, it looks like it only loads the first slice:

    with pytiff.Tiff(input_fpath) as handle:
        img_array = handle
        print(img_array.shape)  # (15, 15) instead of (15,15,15)
@pglock
Copy link
Contributor

pglock commented Aug 15, 2018

if by 3D you mean multi page tiff files, you have to iterate over the pages:

with pytiff.Tiff(input_fpath) as handle:
  for page in handle.pages:
    stack.append(page[:])

Now stack is a list with length 15 and each element is a 15x15 numpy array.

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