We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 174c541 commit c3b2c0fCopy full SHA for c3b2c0f
niworkflows/viz/utils.py
@@ -341,6 +341,8 @@ def plot_registration(
341
if cuts is None:
342
raise NotImplementedError # TODO
343
344
+ anat_nii = _ensure_nii(anat_nii)
345
+
346
out_files = []
347
if estimate_brightness:
348
plot_params = robust_set_limits(anat_nii.get_fdata().reshape(-1), plot_params)
@@ -714,3 +716,9 @@ def plot_melodic_components(
714
716
pad_inches=0.01,
715
717
)
718
fig.clf()
719
720
721
+def _ensure_nii(img: nb.spatialimages.SpatialImage) -> nb.Nifti1Image:
722
+ if not isinstance(img, nb.Nifti1Image):
723
+ img = nb.Nifti1Image(img.dataobj, img.affine, img.header)
724
+ return img
0 commit comments