Created
April 4, 2016 14:14
-
-
Save czotti/9a1f45ea18e85deeb69db1d5bae4537e to your computer and use it in GitHub Desktop.
reading nifti(or supported format) with nibabel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nibabel as nib | |
def read_file(filename): | |
""" | |
Args: | |
----- | |
filename(str): path of your file | |
Output: | |
------- | |
ndarray: numpy array of the data of the file | |
""" | |
img = nib.load(filename) | |
return img.get_data() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment