From 548cf3b65f380f3cdcc4349d36c88bdb4d5df8be Mon Sep 17 00:00:00 2001 From: XueminZhu-Charmaine <54967460+XueminZhu-Charmaine@users.noreply.github.com> Date: Sun, 29 Sep 2019 21:02:33 -0400 Subject: [PATCH] Update nifti_to_png.py The imsave method is deprecated and removed after version 1.3 of SciPy. Using imageio.imsave instead should improve it. --- ndmg/utils/nifti_to_png.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndmg/utils/nifti_to_png.py b/ndmg/utils/nifti_to_png.py index 8c281e924..10b4771c6 100644 --- a/ndmg/utils/nifti_to_png.py +++ b/ndmg/utils/nifti_to_png.py @@ -22,9 +22,9 @@ warnings.simplefilter("ignore") from argparse import ArgumentParser -from scipy.misc import imsave import nibabel as nb import os +import imageio def convert(indir, outdir, verbose=False): @@ -64,7 +64,7 @@ def convert(indir, outdir, verbose=False): for slices in range(dat.shape[2]): if verbose: print("Saving slice:", slices) - imsave( + imageio.imsave( dirname + "/%04d.png" % slices, dat[:, :, slices, count].astype("float32").T, )