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
c20e7c85
Commit
c20e7c85
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
BF: Fix transform/affine imports
parent
fa458217
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/utils/image/resample.py
+7
-7
7 additions, 7 deletions
fsl/utils/image/resample.py
fsl/utils/transform.py
+2
-2
2 additions, 2 deletions
fsl/utils/transform.py
with
9 additions
and
9 deletions
fsl/utils/image/resample.py
+
7
−
7
View file @
c20e7c85
...
...
@@ -15,12 +15,12 @@ sub-functions of :func:`resample`.
"""
import
collections.abc
as
abc
import
collections.abc
as
abc
import
numpy
as
np
import
scipy.ndimage
as
ndimage
import
numpy
as
np
import
scipy.ndimage
as
ndimage
import
fsl.
utils.
transform
as
transform
import
fsl.transform
.affine
as
affine
def
resampleToPixdims
(
image
,
newPixdims
,
**
kwargs
):
...
...
@@ -64,7 +64,7 @@ def resampleToReference(image, reference, **kwargs):
# Align the two images together
# via their vox-to-world affines.
matrix
=
transform
.
concat
(
image
.
worldToVoxMat
,
reference
.
voxToWorldMat
)
matrix
=
affine
.
concat
(
image
.
worldToVoxMat
,
reference
.
voxToWorldMat
)
# If the input image is >3D, we
# have to adjust the resampling
...
...
@@ -218,7 +218,7 @@ def resample(image,
matrix
[:
3
,
:
3
]
=
rotmat
matrix
[:
3
,
-
1
]
=
offsets
matrix
=
transform
.
concat
(
image
.
voxToWorldMat
,
matrix
)
matrix
=
affine
.
concat
(
image
.
voxToWorldMat
,
matrix
)
return
data
,
matrix
...
...
@@ -241,7 +241,7 @@ def applySmoothing(data, matrix, newShape):
:returns: A smoothed copy of ``data``.
"""
ratio
=
transform
.
decompose
(
matrix
[:
3
,
:
3
])[
0
]
ratio
=
affine
.
decompose
(
matrix
[:
3
,
:
3
])[
0
]
if
len
(
newShape
)
>
3
:
ratio
=
np
.
concatenate
((
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/transform.py
+
2
−
2
View file @
c20e7c85
...
...
@@ -9,8 +9,8 @@
"""
import
fsl.utils.deprecated
as
deprecated
from
fsl.
transform
import
*
# noqa
import
fsl.utils.deprecated
as
deprecated
from
fsl.
affine
import
*
# noqa
deprecated
.
warn
(
'
fsl.utils.transform
'
,
...
...
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