From da278a6a0546b4ec9f84abebad4f0234e70fca87 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sun, 30 May 2021 09:31:11 -0400 Subject: [PATCH] MNT: np.bool -> bool --- nipype/algorithms/confounds.py | 6 +++--- nipype/algorithms/metrics.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nipype/algorithms/confounds.py b/nipype/algorithms/confounds.py index 1aa88d6e62..18c268b461 100644 --- a/nipype/algorithms/confounds.py +++ b/nipype/algorithms/confounds.py @@ -613,7 +613,7 @@ def _run_interface(self, runtime): if len(mask_images) == 0: img = nb.Nifti1Image( - np.ones(imgseries.shape[:3], dtype=np.bool), + np.ones(imgseries.shape[:3], dtype=bool), affine=imgseries.affine, header=imgseries.header, ) @@ -835,7 +835,7 @@ def _process_masks(self, mask_images, timeseries=None): self._mask_files = [] timeseries = np.asanyarray(timeseries) for i, img in enumerate(mask_images): - mask = np.asanyarray(img.dataobj).astype(np.bool) + mask = np.asanyarray(img.dataobj).astype(bool) imgseries = timeseries[mask, :] imgseries = regress_poly(2, imgseries)[0] tSTD = _compute_tSTD(imgseries, 0, axis=-1) @@ -1379,7 +1379,7 @@ def compute_noise_components( md_retained = [] for name, img in zip(mask_names, mask_images): - mask = np.asanyarray(nb.squeeze_image(img).dataobj).astype(np.bool) + mask = np.asanyarray(nb.squeeze_image(img).dataobj).astype(bool) if imgseries.shape[:3] != mask.shape: raise ValueError( "Inputs for CompCor, timeseries and mask, do not have " diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index e399becb65..b314197f77 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -88,10 +88,10 @@ def _get_coordinates(self, data, affine): def _eucl_min(self, nii1, nii2): from scipy.spatial.distance import cdist, euclidean - origdata1 = np.asanyarray(nii1.dataobj).astype(np.bool) + origdata1 = np.asanyarray(nii1.dataobj).astype(bool) border1 = self._find_border(origdata1) - origdata2 = np.asanyarray(nii2.dataobj).astype(np.bool) + origdata2 = np.asanyarray(nii2.dataobj).astype(bool) border2 = self._find_border(origdata2) set1_coordinates = self._get_coordinates(border1, nii1.affine) @@ -134,10 +134,10 @@ def _eucl_cog(self, nii1, nii2): def _eucl_mean(self, nii1, nii2, weighted=False): from scipy.spatial.distance import cdist - origdata1 = np.asanyarray(nii1.dataobj).astype(np.bool) + origdata1 = np.asanyarray(nii1.dataobj).astype(bool) border1 = self._find_border(origdata1) - origdata2 = np.asanyarray(nii2.dataobj).astype(np.bool) + origdata2 = np.asanyarray(nii2.dataobj).astype(bool) set1_coordinates = self._get_coordinates(border1, nii1.affine) set2_coordinates = self._get_coordinates(origdata2, nii2.affine)