Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD 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
FSL
fslpy
Commits
4e63aac4
Commit
4e63aac4
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
MNT: Use %-formatting in log calls
parent
bad9585c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/image.py
+12
-13
12 additions, 13 deletions
fsl/data/image.py
with
12 additions
and
13 deletions
fsl/data/image.py
+
12
−
13
View file @
4e63aac4
...
@@ -469,10 +469,10 @@ class Nifti(notifier.Notifier, meta.Meta):
...
@@ -469,10 +469,10 @@ class Nifti(notifier.Notifier, meta.Meta):
self
.
__worldToVoxMat
=
transform
.
invert
(
self
.
__voxToWorldMat
)
self
.
__worldToVoxMat
=
transform
.
invert
(
self
.
__voxToWorldMat
)
log
.
debug
(
'
Affine changed:
\n
pixdims:
'
log
.
debug
(
'
Affine changed:
\n
pixdims:
'
'
{}
\n
sform:
{}
\n
qform:
{}
'
.
format
(
'
%s
\n
sform:
%s
\n
qform:
%s
'
,
header
.
get_zooms
(),
header
.
get_zooms
(),
header
.
get_sform
(),
header
.
get_sform
(),
header
.
get_qform
())
)
header
.
get_qform
())
self
.
notify
(
topic
=
'
transform
'
)
self
.
notify
(
topic
=
'
transform
'
)
...
@@ -1080,13 +1080,13 @@ class Image(Nifti):
...
@@ -1080,13 +1080,13 @@ class Image(Nifti):
# If an image size threshold has not been specified,
# If an image size threshold has not been specified,
# then we'll calculate the full data range right now.
# then we'll calculate the full data range right now.
if
sizethres
is
None
or
nbytes
<
sizethres
:
if
sizethres
is
None
or
nbytes
<
sizethres
:
log
.
debug
(
'
{}
: Forcing calculation of full
'
log
.
debug
(
'
%s
: Forcing calculation of full
'
'
data range
'
.
format
(
self
.
name
)
)
'
data range
'
,
self
.
name
)
self
.
__imageWrapper
[:]
self
.
__imageWrapper
[:]
else
:
else
:
log
.
debug
(
'
{}
: Calculating data range
'
log
.
debug
(
'
%s
: Calculating data range
'
'
from sample
'
.
format
(
self
.
name
)
)
'
from sample
'
,
self
.
name
)
# Otherwise if the number of values in the
# Otherwise if the number of values in the
# image is bigger than the size threshold,
# image is bigger than the size threshold,
...
@@ -1118,7 +1118,7 @@ class Image(Nifti):
...
@@ -1118,7 +1118,7 @@ class Image(Nifti):
if
not
looksLikeImage
(
filename
):
if
not
looksLikeImage
(
filename
):
filename
=
addExt
(
filename
,
mustExist
=
False
)
filename
=
addExt
(
filename
,
mustExist
=
False
)
log
.
debug
(
'
Saving
{}
to
{}
'
.
format
(
self
.
name
,
filename
)
)
log
.
debug
(
'
Saving
%s
to
%s
'
,
self
.
name
,
filename
)
# We save the image out to a temp file,
# We save the image out to a temp file,
# then close the old image, move the
# then close the old image, move the
...
@@ -1262,7 +1262,7 @@ class Image(Nifti):
...
@@ -1262,7 +1262,7 @@ class Image(Nifti):
:arg sliceobj: Something which can slice the image data.
:arg sliceobj: Something which can slice the image data.
"""
"""
log
.
debug
(
'
{}
: __getitem__ [
{}]
'
.
format
(
self
.
name
,
sliceobj
)
)
log
.
debug
(
'
%s
: __getitem__ [
%s]
'
,
self
.
name
,
sliceobj
)
return
self
.
__imageWrapper
.
__getitem__
(
sliceobj
)
return
self
.
__imageWrapper
.
__getitem__
(
sliceobj
)
...
@@ -1278,9 +1278,8 @@ class Image(Nifti):
...
@@ -1278,9 +1278,8 @@ class Image(Nifti):
"""
"""
values
=
np
.
array
(
values
)
values
=
np
.
array
(
values
)
log
.
debug
(
'
{}: __setitem__ [{} = {}]
'
.
format
(
self
.
name
,
log
.
debug
(
'
%s: __setitem__ [%s = %s]
'
,
sliceobj
,
self
.
name
,
sliceobj
,
values
.
shape
)
values
.
shape
))
with
self
.
__imageWrapper
.
skip
(
self
.
__lName
):
with
self
.
__imageWrapper
.
skip
(
self
.
__lName
):
...
...
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