Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Updated set_transform(), removed pbar grad_str text
Browse files Browse the repository at this point in the history
  • Loading branch information
teresamg authored and oesteban committed Mar 27, 2024
1 parent a3a3f1b commit f18029e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/eddymotion/data/dmri.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/eddymotion/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f18029e

Please sign in to comment.