Skip to content

Instantly share code, notes, and snippets.

@ctrueden
Last active April 20, 2019 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctrueden/cfd4b42c49767b55b2d351c8b886bedf to your computer and use it in GitHub Desktop.
Save ctrueden/cfd4b42c49767b55b2d351c8b886bedf to your computer and use it in GitHub Desktop.
Open an image with Bio-Formats as a numpy array via pyimagej
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ctrueden
Copy link
Author

ctrueden commented Mar 8, 2019

@ctrueden
Copy link
Author

ctrueden commented Mar 8, 2019

For NIFTI specifically, there are much easier ways:

import nibabel as nib
img = nib.load(filename)
data = img.get_fdata()

But the above notebook should work for nearly all the Bio-Formats-supported formats, including ones without convenient Python libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment