Skip to content

Commit

Permalink
MNT: np.bool -> bool
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jun 16, 2021
1 parent 9745ebd commit da278a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions nipype/algorithms/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 "
Expand Down
8 changes: 4 additions & 4 deletions nipype/algorithms/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit da278a6

Please sign in to comment.