Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Evan Edmond
fslpy
Commits
48b09f65
Commit
48b09f65
authored
Feb 19, 2021
by
Paul McCarthy
🚵
Browse files
MNT: Silence numpy deprecation warnings
parent
bed22ace
Changes
4
Hide whitespace changes
Inline
Side-by-side
fsl/data/imagewrapper.py
View file @
48b09f65
...
@@ -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
))
...
...
fsl/data/mesh.py
View file @
48b09f65
...
@@ -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
...
...
fsl/transform/affine.py
View file @
48b09f65
...
@@ -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
):
...
...
fsl/utils/image/resample.py
View file @
48b09f65
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment