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
f1fbcb32
Commit
f1fbcb32
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF: Cosmetic linting
parent
dc5eadb2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/transform/nonlinear.py
+7
-5
7 additions, 5 deletions
fsl/transform/nonlinear.py
with
7 additions
and
5 deletions
fsl/transform/nonlinear.py
+
7
−
5
View file @
f1fbcb32
...
@@ -496,13 +496,11 @@ class CoefficientField(NonLinearTransform):
...
@@ -496,13 +496,11 @@ class CoefficientField(NonLinearTransform):
fdata
=
self
.
data
fdata
=
self
.
data
nx
,
ny
,
nz
=
self
.
shape
[:
3
]
nx
,
ny
,
nz
=
self
.
shape
[:
3
]
ix
,
iy
,
iz
=
self
.
ref
.
shape
[:
3
]
# Convert the given voxel coordinates
# Convert the given voxel coordinates
# into the corresponding coefficient
# into the corresponding coefficient
# field voxel coordinates
# 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
# i, j, k: coefficient field indices
# u, v, w: position of the ref voxel
# u, v, w: position of the ref voxel
...
@@ -582,6 +580,10 @@ def convertDeformationType(field, defType=None):
...
@@ -582,6 +580,10 @@ def convertDeformationType(field, defType=None):
if
field
.
deformationType
==
'
absolute
'
:
defType
=
'
relative
'
if
field
.
deformationType
==
'
absolute
'
:
defType
=
'
relative
'
else
:
defType
=
'
absolute
'
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,
# Regardless of the conversion direction,
# we need the coordinates of every voxel
# we need the coordinates of every voxel
# in the reference coordinate system.
# in the reference coordinate system.
...
@@ -601,8 +603,8 @@ def convertDeformationType(field, defType=None):
...
@@ -601,8 +603,8 @@ def convertDeformationType(field, defType=None):
# assumed to be) the relative shift. Or,
# assumed to be) the relative shift. Or,
# to convert from absolute to relative,
# to convert from absolute to relative,
# we subtract the reference image voxels.
# we subtract the reference image voxels.
if
defType
==
'
absolute
'
:
return
field
.
data
+
coords
if
defType
==
'
absolute
'
:
return
field
.
data
+
coords
el
if
defType
==
'
relative
'
:
return
field
.
data
-
coords
el
se
:
return
field
.
data
-
coords
def
convertDeformationSpace
(
field
,
from_
,
to
):
def
convertDeformationSpace
(
field
,
from_
,
to
):
...
...
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