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
FSL
fslpy
Commits
f1fbcb32
Commit
f1fbcb32
authored
Sep 21, 2020
by
Paul McCarthy
🚵
Browse files
RF: Cosmetic linting
parent
dc5eadb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/transform/nonlinear.py
View file @
f1fbcb32
...
...
@@ -496,13 +496,11 @@ class CoefficientField(NonLinearTransform):
fdata
=
self
.
data
nx
,
ny
,
nz
=
self
.
shape
[:
3
]
ix
,
iy
,
iz
=
self
.
ref
.
shape
[:
3
]
# Convert the given voxel coordinates
# into the corresponding coefficient
# field voxel coordinates
x
,
y
,
z
=
coords
.
T
i
,
j
,
k
=
affine
.
transform
(
coords
,
self
.
refToFieldMat
).
T
i
,
j
,
k
=
affine
.
transform
(
coords
,
self
.
refToFieldMat
).
T
# i, j, k: coefficient field indices
# u, v, w: position of the ref voxel
...
...
@@ -582,6 +580,10 @@ def convertDeformationType(field, defType=None):
if
field
.
deformationType
==
'absolute'
:
defType
=
'relative'
else
:
defType
=
'absolute'
if
defType
not
in
(
'absolute'
,
'relative'
):
raise
ValueError
(
'defType must be "absolute" or "relative" '
'("{}" passed)'
.
format
(
defType
))
# Regardless of the conversion direction,
# we need the coordinates of every voxel
# in the reference coordinate system.
...
...
@@ -601,8 +603,8 @@ def convertDeformationType(field, defType=None):
# assumed to be) the relative shift. Or,
# to convert from absolute to relative,
# we subtract the reference image voxels.
if
defType
==
'absolute'
:
return
field
.
data
+
coords
el
if
defType
==
'relative'
:
return
field
.
data
-
coords
if
defType
==
'absolute'
:
return
field
.
data
+
coords
el
se
:
return
field
.
data
-
coords
def
convertDeformationSpace
(
field
,
from_
,
to
):
...
...
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