diff --git a/src/eddymotion/data/dmri.py b/src/eddymotion/data/dmri.py index 0da7ad14..bfc4c788 100644 --- a/src/eddymotion/data/dmri.py +++ b/src/eddymotion/data/dmri.py @@ -83,7 +83,7 @@ def set_data(self): with h5py.File(self._filepath, "r") as in_file: self._root = in_file["/0"] - def set_transform(self, dwframe, bvec, index, affine, order=3): + def set_transform(self, index, affine, order=3): """Set an affine, and update data object and gradients.""" reference = namedtuple("ImageGrid", ("shape", "affine"))( shape=self.dataobj.shape[:3], affine=self.affine @@ -96,6 +96,9 @@ def set_transform(self, dwframe, bvec, index, affine, order=3): else: xform = Affine(matrix=affine, reference=reference) + dwframe = np.asanyarray(self.dataobj[..., index]) + bvec = np.asanyarray(self.gradients[:3, index]) + dwmoving = nb.Nifti1Image(dwframe, self.affine, None) # resample and update orientation at index diff --git a/src/eddymotion/estimator.py b/src/eddymotion/estimator.py index b864c266..57cc4cd6 100644 --- a/src/eddymotion/estimator.py +++ b/src/eddymotion/estimator.py @@ -153,9 +153,6 @@ def fit( ) data_train, data_test = logo_split(dwdata, i) - grad_str = f"{i}, {data_test[1][:3]}, b={int(data_test[1][3])}" - pbar.set_description_str(f"[{grad_str}], {n_jobs} jobs") - if not single_model: # A true LOGO estimator if hasattr(dwdata, "gradients"): kwargs["gtab"] = data_train[1]