Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit da278a6

Browse files
committedJun 16, 2021
MNT: np.bool -> bool
1 parent 9745ebd commit da278a6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎nipype/algorithms/confounds.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def _run_interface(self, runtime):
613613

614614
if len(mask_images) == 0:
615615
img = nb.Nifti1Image(
616-
np.ones(imgseries.shape[:3], dtype=np.bool),
616+
np.ones(imgseries.shape[:3], dtype=bool),
617617
affine=imgseries.affine,
618618
header=imgseries.header,
619619
)
@@ -835,7 +835,7 @@ def _process_masks(self, mask_images, timeseries=None):
835835
self._mask_files = []
836836
timeseries = np.asanyarray(timeseries)
837837
for i, img in enumerate(mask_images):
838-
mask = np.asanyarray(img.dataobj).astype(np.bool)
838+
mask = np.asanyarray(img.dataobj).astype(bool)
839839
imgseries = timeseries[mask, :]
840840
imgseries = regress_poly(2, imgseries)[0]
841841
tSTD = _compute_tSTD(imgseries, 0, axis=-1)
@@ -1379,7 +1379,7 @@ def compute_noise_components(
13791379
md_retained = []
13801380

13811381
for name, img in zip(mask_names, mask_images):
1382-
mask = np.asanyarray(nb.squeeze_image(img).dataobj).astype(np.bool)
1382+
mask = np.asanyarray(nb.squeeze_image(img).dataobj).astype(bool)
13831383
if imgseries.shape[:3] != mask.shape:
13841384
raise ValueError(
13851385
"Inputs for CompCor, timeseries and mask, do not have "

‎nipype/algorithms/metrics.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ def _get_coordinates(self, data, affine):
8888
def _eucl_min(self, nii1, nii2):
8989
from scipy.spatial.distance import cdist, euclidean
9090

91-
origdata1 = np.asanyarray(nii1.dataobj).astype(np.bool)
91+
origdata1 = np.asanyarray(nii1.dataobj).astype(bool)
9292
border1 = self._find_border(origdata1)
9393

94-
origdata2 = np.asanyarray(nii2.dataobj).astype(np.bool)
94+
origdata2 = np.asanyarray(nii2.dataobj).astype(bool)
9595
border2 = self._find_border(origdata2)
9696

9797
set1_coordinates = self._get_coordinates(border1, nii1.affine)
@@ -134,10 +134,10 @@ def _eucl_cog(self, nii1, nii2):
134134
def _eucl_mean(self, nii1, nii2, weighted=False):
135135
from scipy.spatial.distance import cdist
136136

137-
origdata1 = np.asanyarray(nii1.dataobj).astype(np.bool)
137+
origdata1 = np.asanyarray(nii1.dataobj).astype(bool)
138138
border1 = self._find_border(origdata1)
139139

140-
origdata2 = np.asanyarray(nii2.dataobj).astype(np.bool)
140+
origdata2 = np.asanyarray(nii2.dataobj).astype(bool)
141141

142142
set1_coordinates = self._get_coordinates(border1, nii1.affine)
143143
set2_coordinates = self._get_coordinates(origdata2, nii2.affine)

0 commit comments

Comments
 (0)