From 71c6f95446aef4dd5da9ccd5e300a5280daa3cb1 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 13 Feb 2023 06:52:05 +1100 Subject: [PATCH] nibabel import --- fileformats/medimage/nifti.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fileformats/medimage/nifti.py b/fileformats/medimage/nifti.py index ae3ed56..8321d52 100644 --- a/fileformats/medimage/nifti.py +++ b/fileformats/medimage/nifti.py @@ -1,4 +1,3 @@ -import nibabel from fileformats.generic import File from fileformats.core import mark from fileformats.core.mixin import ( @@ -14,10 +13,12 @@ class Nifti(NeuroImage): ext = ".nii" def load_metadata(self): + import nibabel return dict(nibabel.load(self.fspath).header) @property def data_array(self): + import nibabel return nibabel.load(self.fspath).get_data() @property