Commit 48b09f65 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

MNT: Silence numpy deprecation warnings

parent bed22ace
...@@ -733,7 +733,7 @@ def isValidFancySliceObj(sliceobj, shape): ...@@ -733,7 +733,7 @@ def isValidFancySliceObj(sliceobj, shape):
# We only support boolean numpy arrays # We only support boolean numpy arrays
# which have the same shape as the image # which have the same shape as the image
return (isinstance(sliceobj, np.ndarray) and return (isinstance(sliceobj, np.ndarray) and
sliceobj.dtype == np.bool and sliceobj.dtype == bool and
np.prod(sliceobj.shape) == np.prod(shape)) np.prod(sliceobj.shape) == np.prod(shape))
......
...@@ -701,7 +701,7 @@ def calcVertexNormals(vertices, indices, fnormals): ...@@ -701,7 +701,7 @@ def calcVertexNormals(vertices, indices, fnormals):
the mesh. the mesh.
""" """
vnormals = np.zeros((vertices.shape[0], 3), dtype=np.float) vnormals = np.zeros((vertices.shape[0], 3), dtype=float)
# TODO make fast. I can't figure # TODO make fast. I can't figure
# out how to use np.add.at to # out how to use np.add.at to
......
...@@ -627,8 +627,8 @@ def rescale(oldShape, newShape, origin=None): ...@@ -627,8 +627,8 @@ def rescale(oldShape, newShape, origin=None):
if origin is None: if origin is None:
origin = 'centre' origin = 'centre'
oldShape = np.array(oldShape, dtype=np.float) oldShape = np.array(oldShape, dtype=float)
newShape = np.array(newShape, dtype=np.float) newShape = np.array(newShape, dtype=float)
ndim = len(oldShape) ndim = len(oldShape)
if len(oldShape) != len(newShape): if len(oldShape) != len(newShape):
......
...@@ -209,7 +209,7 @@ def resample(image, ...@@ -209,7 +209,7 @@ def resample(image,
np.all(np.isclose(matrix, np.eye(len(newShape) + 1))): np.all(np.isclose(matrix, np.eye(len(newShape) + 1))):
return data, image.voxToWorldMat return data, image.voxToWorldMat
newShape = np.array(np.round(newShape), dtype=np.int) newShape = np.array(np.round(newShape), dtype=int)
# Apply smoothing if requested, # Apply smoothing if requested,
# and if not using nn interp # and if not using nn interp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment