Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
e57c406d
Commit
e57c406d
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF: Avoid various warnings
parent
fe8d6524
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fsl/data/image.py
+2
-1
2 additions, 1 deletion
fsl/data/image.py
fsl/data/imagewrapper.py
+6
-5
6 additions, 5 deletions
fsl/data/imagewrapper.py
fsl/utils/transform.py
+7
-7
7 additions, 7 deletions
fsl/utils/transform.py
with
15 additions
and
13 deletions
fsl/data/image.py
+
2
−
1
View file @
e57c406d
...
...
@@ -814,7 +814,8 @@ class Image(Nifti):
if
indexed
is
not
False
:
warnings
.
warn
(
'
The indexed argument is deprecated
'
'
and has no effect
'
,
category
=
DeprecationWarning
)
category
=
DeprecationWarning
,
stacklevel
=
2
)
if
loadData
:
threaded
=
False
...
...
This diff is collapsed.
Click to expand it.
fsl/data/imagewrapper.py
+
6
−
5
View file @
e57c406d
...
...
@@ -37,9 +37,10 @@ get their definitions straight:
"""
import
logging
import
collections
import
itertools
as
it
import
logging
import
collections
import
collections.abc
as
abc
import
itertools
as
it
import
numpy
as
np
import
nibabel
as
nib
...
...
@@ -689,7 +690,7 @@ class ImageWrapper(notifier.Notifier):
# If we are slicing a scalar, the
# assigned value has to be scalar.
if
expNdims
==
0
and
isinstance
(
values
,
collections
.
Sequence
):
if
expNdims
==
0
and
isinstance
(
values
,
abc
.
Sequence
):
if
len
(
values
)
>
1
:
raise
IndexError
(
'
Invalid assignment: [{}] = {}
'
.
format
(
...
...
@@ -828,7 +829,7 @@ def sliceObjToSliceTuple(sliceobj, shape):
# The sliceobj could be a single sliceobj
# or integer, instead of a tuple
if
not
isinstance
(
sliceobj
,
collections
.
Sequence
):
if
not
isinstance
(
sliceobj
,
abc
.
Sequence
):
sliceobj
=
[
sliceobj
]
# Turn e.g. array[6] into array[6, :, :]
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/transform.py
+
7
−
7
View file @
e57c406d
...
...
@@ -34,9 +34,9 @@ And a few more functions are provided for working with vectors:
normalise
"""
import
numpy
as
np
import
numpy.linalg
as
linalg
import
collections
import
numpy
as
np
import
numpy.linalg
as
linalg
import
collections
.abc
as
abc
def
invert
(
x
):
...
...
@@ -94,7 +94,7 @@ def scaleOffsetXform(scales, offsets):
:returns: A ``numpy.float32`` array of size :math:`4
\\
times 4`.
"""
oktypes
=
(
collections
.
Sequence
,
np
.
ndarray
)
oktypes
=
(
abc
.
Sequence
,
np
.
ndarray
)
if
not
isinstance
(
scales
,
oktypes
):
scales
=
[
scales
]
if
not
isinstance
(
offsets
,
oktypes
):
offsets
=
[
offsets
]
...
...
@@ -398,7 +398,7 @@ def axisBounds(shape,
if
axes
is
None
:
axes
=
[
0
,
1
,
2
]
elif
not
isinstance
(
axes
,
collections
.
Iterable
):
elif
not
isinstance
(
axes
,
abc
.
Iterable
):
scalar
=
True
axes
=
[
axes
]
...
...
@@ -507,13 +507,13 @@ def _fillPoints(p, axes):
or an ``N*2`` or ``N*3`` array.
"""
if
not
isinstance
(
p
,
collections
.
Iterable
):
p
=
[
p
]
if
not
isinstance
(
p
,
abc
.
Iterable
):
p
=
[
p
]
p
=
np
.
array
(
p
)
if
axes
is
None
:
return
p
if
not
isinstance
(
axes
,
collections
.
Iterable
):
axes
=
[
axes
]
if
not
isinstance
(
axes
,
abc
.
Iterable
):
axes
=
[
axes
]
if
p
.
ndim
==
1
:
p
=
p
.
reshape
((
len
(
p
),
1
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment