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
2e9c4517
Commit
2e9c4517
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix in transform (numpy.linalg.dot does not exist - it's
numpy.dot). And a few tweaks elsewhere
parent
ef5ea65e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fsl/fslview/displaycontext.py
+3
-3
3 additions, 3 deletions
fsl/fslview/displaycontext.py
fsl/fslview/views/orthopanel.py
+9
-4
9 additions, 4 deletions
fsl/fslview/views/orthopanel.py
fsl/utils/transform.py
+1
-1
1 addition, 1 deletion
fsl/utils/transform.py
with
13 additions
and
8 deletions
fsl/fslview/displaycontext.py
+
3
−
3
View file @
2e9c4517
...
@@ -318,15 +318,15 @@ class ImageDisplay(props.HasProperties):
...
@@ -318,15 +318,15 @@ class ImageDisplay(props.HasProperties):
pixdim
=
self
.
image
.
pixdim
pixdim
=
self
.
image
.
pixdim
voxToDisplayMat
=
np
.
diag
([
pixdim
[
0
],
pixdim
[
1
],
pixdim
[
2
],
1.0
])
voxToDisplayMat
=
np
.
diag
([
pixdim
[
0
],
pixdim
[
1
],
pixdim
[
2
],
1.0
])
elif
self
.
transform
==
'
affine
'
:
elif
self
.
transform
==
'
affine
'
:
voxToDisplayMat
=
self
.
image
.
voxToWorldMat
voxToDisplayMat
=
self
.
voxToWorldMat
voxToDisplayMat
=
np
.
array
(
voxToDisplayMat
,
dtype
=
np
.
float32
)
voxToDisplayMat
=
np
.
array
(
voxToDisplayMat
,
dtype
=
np
.
float32
)
displayToVoxMat
=
transform
.
invert
(
voxToDisplayMat
)
displayToVoxMat
=
transform
.
invert
(
voxToDisplayMat
)
# Transformation matrices for moving between the voxel
# Transformation matrices for moving between the voxel
# coordinate system and the display coordinate system
# coordinate system and the display coordinate system
self
.
voxToDisplayMat
=
voxToDisplayMat
.
transpose
()
self
.
voxToDisplayMat
=
voxToDisplayMat
self
.
displayToVoxMat
=
displayToVoxMat
.
transpose
()
self
.
displayToVoxMat
=
displayToVoxMat
# Matrices for moving between the display coordinate
# Matrices for moving between the display coordinate
# system, and the image world coordinate system
# system, and the image world coordinate system
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/views/orthopanel.py
+
9
−
4
View file @
2e9c4517
...
@@ -290,10 +290,6 @@ class OrthoPanel(canvaspanel.CanvasPanel):
...
@@ -290,10 +290,6 @@ class OrthoPanel(canvaspanel.CanvasPanel):
for changes on its affine transformation matrix.
for changes on its affine transformation matrix.
"""
"""
self
.
_refreshLabels
()
if
len
(
self
.
_imageList
)
==
0
:
return
for
i
,
img
in
enumerate
(
self
.
_imageList
):
for
i
,
img
in
enumerate
(
self
.
_imageList
):
display
=
img
.
getAttribute
(
'
display
'
)
display
=
img
.
getAttribute
(
'
display
'
)
...
@@ -307,6 +303,12 @@ class OrthoPanel(canvaspanel.CanvasPanel):
...
@@ -307,6 +303,12 @@ class OrthoPanel(canvaspanel.CanvasPanel):
self
.
_name
,
self
.
_name
,
self
.
_refreshLabels
)
self
.
_refreshLabels
)
# _refreshLabels will in turn call
# _layoutChanged, which is needed
# in case the display bounds have
# changed
self
.
_refreshLabels
()
def
_onDestroy
(
self
,
ev
):
def
_onDestroy
(
self
,
ev
):
"""
Called when this panel is destroyed.
"""
Called when this panel is destroyed.
...
@@ -585,6 +587,9 @@ class OrthoPanel(canvaspanel.CanvasPanel):
...
@@ -585,6 +587,9 @@ class OrthoPanel(canvaspanel.CanvasPanel):
self
.
_zCanvasPanel
.
Show
(
self
.
showZCanvas
)
self
.
_zCanvasPanel
.
Show
(
self
.
showZCanvas
)
if
len
(
canvases
)
==
0
:
if
len
(
canvases
)
==
0
:
self
.
Layout
()
self
.
getCanvasPanel
().
Layout
()
self
.
Refresh
()
return
return
# Regardless of the layout, we use a
# Regardless of the layout, we use a
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/transform.py
+
1
−
1
View file @
2e9c4517
...
@@ -20,7 +20,7 @@ def invert(x):
...
@@ -20,7 +20,7 @@ def invert(x):
def
concat
(
x1
,
x2
):
def
concat
(
x1
,
x2
):
"""
Combines the two matrices (returns the dot product).
"""
"""
Combines the two matrices (returns the dot product).
"""
return
linalg
.
dot
(
x1
,
x2
)
return
np
.
dot
(
x1
,
x2
)
def
axisBounds
(
shape
,
xform
,
axis
):
def
axisBounds
(
shape
,
xform
,
axis
):
...
...
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