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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
3a607236
Commit
3a607236
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
BF: only add in-bounds coordinates
parent
eccddc1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/transform/nonlinear.py
+6
-6
6 additions, 6 deletions
fsl/transform/nonlinear.py
with
6 additions
and
6 deletions
fsl/transform/nonlinear.py
+
6
−
6
View file @
3a607236
...
...
@@ -215,7 +215,7 @@ class DisplacementField(NonLinearTransform):
xs
,
ys
,
zs
=
voxels
.
T
if
self
.
absolute
:
disps
=
self
.
data
[
xs
,
ys
,
zs
,
:]
else
:
disps
=
self
.
data
[
xs
,
ys
,
zs
,
:]
+
coords
else
:
disps
=
self
.
data
[
xs
,
ys
,
zs
,
:]
+
coords
[
voxmask
]
# Make sure the coordinates
# are in the requested
...
...
@@ -302,8 +302,8 @@ def convertDisplacementSpace(field, from_, to):
:arg from_: New source image coordinate system
:arg to: New reference image coordinate system
:returns: A new :class:`DisplacementField` which transforms
from
the source ``from_`` coordinate system
to
the reference ``to``
:returns: A new :class:`DisplacementField` which transforms
between
the source ``from_`` coordinate system
and
the reference ``to``
coordinate system.
"""
...
...
@@ -330,12 +330,12 @@ def convertDisplacementSpace(field, from_, to):
# Otherwise our displacement field
# will contain relative displacements
# betwee the reference image "to"
# betwee
n
the reference image "to"
# coordinate system and the source
# image "from_" coordinate system.
# We need to re-calculate the relative
# displacements
from
source "from_"
# space
into
reference "to" space.
# displacements
between
source "from_"
# space
and
reference "to" space.
else
:
refmat
=
field
.
ref
.
getAffine
(
field
.
refSpace
,
to
)
refcoords
=
fieldcoords
.
reshape
((
-
1
,
3
))
...
...
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