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

Convenience function for retrieving numpy arrays? #42

Open
haesleinhuepf opened this issue Dec 18, 2022 · 0 comments
Open

Convenience function for retrieving numpy arrays? #42

haesleinhuepf opened this issue Dec 18, 2022 · 0 comments

Comments

@haesleinhuepf
Copy link

Hi @nimne ,

I was just using your readlif library and I was wondering if there is a way for retrieving a 3D stack from a .lif file in a convenient way. I wrote this function:

def lif_to_numpy_stack(lif_image):
    num_slices = lif_image.info['dims'].z
    
    return np.asarray([np.array(lif_image.get_frame(z=0)) for z in range(num_slices)])

And I'm now wondering if readlif already contains such a convenience function and/or if I should send a pull-request with it. Otherwise, might it make sense to add an example for reading a 3D stack to the readme?

Thanks!

Best,
Robert

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

1 participant