Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
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`.
...
@@ -15,12 +15,12 @@ sub-functions of :func:`resample`.
"""
"""
import
collections.abc
as
abc
import
collections.abc
as
abc
import
numpy
as
np
import
numpy
as
np
import
scipy.ndimage
as
ndimage
import
scipy.ndimage
as
ndimage
import
fsl.
utils.
transform
as
transform
import
fsl.transform
.affine
as
affine
def
resampleToPixdims
(
image
,
newPixdims
,
**
kwargs
):
def
resampleToPixdims
(
image
,
newPixdims
,
**
kwargs
):
...
@@ -64,7 +64,7 @@ def resampleToReference(image, reference, **kwargs):
...
@@ -64,7 +64,7 @@ def resampleToReference(image, reference, **kwargs):
# Align the two images together
# Align the two images together
# via their vox-to-world affines.
# 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
# If the input image is >3D, we
# have to adjust the resampling
# have to adjust the resampling
...
@@ -218,7 +218,7 @@ def resample(image,
...
@@ -218,7 +218,7 @@ def resample(image,
matrix
[:
3
,
:
3
]
=
rotmat
matrix
[:
3
,
:
3
]
=
rotmat
matrix
[:
3
,
-
1
]
=
offsets
matrix
[:
3
,
-
1
]
=
offsets
matrix
=
transform
.
concat
(
image
.
voxToWorldMat
,
matrix
)
matrix
=
affine
.
concat
(
image
.
voxToWorldMat
,
matrix
)
return
data
,
matrix
return
data
,
matrix
...
@@ -241,7 +241,7 @@ def applySmoothing(data, matrix, newShape):
...
@@ -241,7 +241,7 @@ def applySmoothing(data, matrix, newShape):
:returns: A smoothed copy of ``data``.
:returns: A smoothed copy of ``data``.
"""
"""
ratio
=
transform
.
decompose
(
matrix
[:
3
,
:
3
])[
0
]
ratio
=
affine
.
decompose
(
matrix
[:
3
,
:
3
])[
0
]
if
len
(
newShape
)
>
3
:
if
len
(
newShape
)
>
3
:
ratio
=
np
.
concatenate
((
ratio
=
np
.
concatenate
((
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/transform.py
+
2
−
2
View file @
c20e7c85
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
"""
"""
import
fsl.utils.deprecated
as
deprecated
import
fsl.utils.deprecated
as
deprecated
from
fsl.
transform
import
*
# noqa
from
fsl.
affine
import
*
# noqa
deprecated
.
warn
(
'
fsl.utils.transform
'
,
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