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
e768c0c6
Commit
e768c0c6
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Removed spacepanel, as it is silly. It will be in git history if i
ever want to use it again.
parent
241b6bc0
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/data/strings.py
+0
-1
0 additions, 1 deletion
fsl/data/strings.py
fsl/fslview/views/__init__.py
+0
-3
0 additions, 3 deletions
fsl/fslview/views/__init__.py
fsl/fslview/views/spacepanel.py
+0
-204
0 additions, 204 deletions
fsl/fslview/views/spacepanel.py
with
0 additions
and
208 deletions
fsl/data/strings.py
+
0
−
1
View file @
e768c0c6
...
@@ -95,7 +95,6 @@ titles = TypeDict({
...
@@ -95,7 +95,6 @@ titles = TypeDict({
'
LightBoxPanel
'
:
'
Lightbox View
'
,
'
LightBoxPanel
'
:
'
Lightbox View
'
,
'
TimeSeriesPanel
'
:
'
Time series
'
,
'
TimeSeriesPanel
'
:
'
Time series
'
,
'
HistogramPanel
'
:
'
Histogram
'
,
'
HistogramPanel
'
:
'
Histogram
'
,
'
SpacePanel
'
:
'
Space inspector
'
,
'
CanvasPanel.screenshot
'
:
'
Save screenshot
'
,
'
CanvasPanel.screenshot
'
:
'
Save screenshot
'
,
'
CanvasPanel.screenshot.notSaved
'
:
'
Save overlay before continuing
'
,
'
CanvasPanel.screenshot.notSaved
'
:
'
Save overlay before continuing
'
,
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/views/__init__.py
+
0
−
3
View file @
e768c0c6
...
@@ -23,7 +23,6 @@ import orthopanel
...
@@ -23,7 +23,6 @@ import orthopanel
import
lightboxpanel
import
lightboxpanel
import
timeseriespanel
import
timeseriespanel
import
histogrampanel
import
histogrampanel
import
spacepanel
FSLViewPanel
=
fslpanel
.
FSLViewPanel
FSLViewPanel
=
fslpanel
.
FSLViewPanel
CanvasPanel
=
canvaspanel
.
CanvasPanel
CanvasPanel
=
canvaspanel
.
CanvasPanel
...
@@ -31,8 +30,6 @@ OrthoPanel = orthopanel .OrthoPanel
...
@@ -31,8 +30,6 @@ OrthoPanel = orthopanel .OrthoPanel
LightBoxPanel
=
lightboxpanel
.
LightBoxPanel
LightBoxPanel
=
lightboxpanel
.
LightBoxPanel
TimeSeriesPanel
=
timeseriespanel
.
TimeSeriesPanel
TimeSeriesPanel
=
timeseriespanel
.
TimeSeriesPanel
HistogramPanel
=
histogrampanel
.
HistogramPanel
HistogramPanel
=
histogrampanel
.
HistogramPanel
SpacePanel
=
spacepanel
.
SpacePanel
def
listViewPanels
():
def
listViewPanels
():
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/views/spacepanel.py
deleted
100644 → 0
+
0
−
204
View file @
241b6bc0
#!/usr/bin/env python
#
# SpacePanel.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import
logging
log
=
logging
.
getLogger
(
__name__
)
import
numpy
as
np
import
fsl.data.strings
as
strings
import
fsl.data.image
as
fslimage
import
fsl.utils.transform
as
transform
import
plotpanel
class
SpacePanel
(
plotpanel
.
PlotPanel
):
def
__init__
(
self
,
parent
,
overlayList
,
displayCtx
):
plotpanel
.
PlotPanel
.
__init__
(
self
,
parent
,
overlayList
,
displayCtx
,
proj
=
'
3d
'
)
figure
=
self
.
getFigure
()
canvas
=
self
.
getCanvas
()
axis
=
self
.
getAxis
()
axis
.
mouse_init
()
# the canvas doesn't seem to refresh itself,
# so we'll do it manually on mouse events
def
draw
(
*
a
):
canvas
.
draw
()
canvas
.
mpl_connect
(
'
button_press_event
'
,
draw
)
canvas
.
mpl_connect
(
'
motion_notify_event
'
,
draw
)
canvas
.
mpl_connect
(
'
button_release_event
'
,
draw
)
figure
.
subplots_adjust
(
top
=
1.0
,
bottom
=
0.0
,
left
=
0.0
,
right
=
1.0
)
figure
.
patch
.
set_visible
(
False
)
self
.
_overlayList
.
addListener
(
'
overlays
'
,
self
.
_name
,
self
.
_selectedOverlayChanged
)
self
.
_displayCtx
.
addListener
(
'
selectedOverlay
'
,
self
.
_name
,
self
.
_selectedOverlayChanged
)
self
.
_selectedOverlayChanged
()
def
destroy
(
self
):
"""
De-registers property listeners.
"""
plotpanel
.
PlotPanel
.
destroy
(
self
)
self
.
_overlayList
.
removeListener
(
'
overlays
'
,
self
.
_name
)
self
.
_displayCtx
.
removeListener
(
'
selectedOverlay
'
,
self
.
_name
)
for
overlay
in
self
.
_overlayList
:
display
=
self
.
_displayCtx
.
getDisplay
(
overlay
)
display
.
removeListener
(
'
transform
'
,
self
.
_name
)
def
_selectedOverlayChanged
(
self
,
*
a
):
axis
=
self
.
getAxis
()
canvas
=
self
.
getCanvas
()
axis
.
clear
()
if
len
(
self
.
_overlayList
)
==
0
:
canvas
.
draw
()
return
overlay
=
self
.
_displayCtx
.
getSelectedOverlay
()
display
=
self
.
_displayCtx
.
getDisplay
(
overlay
)
opts
=
display
.
getDisplayOpts
()
if
not
isinstance
(
overlay
,
fslimage
.
Image
):
self
.
message
(
strings
.
messages
[
self
,
'
nonVolumetric
'
])
return
opts
.
addListener
(
'
transform
'
,
self
.
_name
,
self
.
_selectedOverlayChanged
,
overwrite
=
True
)
axis
.
set_title
(
display
.
name
)
axis
.
set_xlabel
(
'
X
'
)
axis
.
set_ylabel
(
'
Y
'
)
axis
.
set_zlabel
(
'
Z
'
)
self
.
_plotOverlayCorners
(
overlay
,
opts
)
self
.
_plotOverlayBounds
(
overlay
,
opts
)
self
.
_plotOverlayLabels
(
overlay
,
opts
)
self
.
_plotAxisLengths
(
overlay
,
opts
)
axis
.
legend
()
canvas
.
draw
()
def
_plotOverlayBounds
(
self
,
overlay
,
opts
):
v2DMat
=
opts
.
getTransform
(
'
voxel
'
,
'
display
'
)
xlo
,
xhi
=
transform
.
axisBounds
(
overlay
.
shape
,
v2DMat
,
0
)
ylo
,
yhi
=
transform
.
axisBounds
(
overlay
.
shape
,
v2DMat
,
1
)
zlo
,
zhi
=
transform
.
axisBounds
(
overlay
.
shape
,
v2DMat
,
2
)
points
=
np
.
zeros
((
8
,
3
),
dtype
=
np
.
float32
)
points
[
0
,
:]
=
[
xlo
,
ylo
,
zlo
]
points
[
1
,
:]
=
[
xlo
,
ylo
,
zhi
]
points
[
2
,
:]
=
[
xlo
,
yhi
,
zlo
]
points
[
3
,
:]
=
[
xlo
,
yhi
,
zhi
]
points
[
4
,
:]
=
[
xhi
,
ylo
,
zlo
]
points
[
5
,
:]
=
[
xhi
,
ylo
,
zhi
]
points
[
6
,
:]
=
[
xhi
,
yhi
,
zlo
]
points
[
7
,
:]
=
[
xhi
,
yhi
,
zhi
]
self
.
getAxis
().
scatter
(
points
[:,
0
],
points
[:,
1
],
points
[:,
2
],
color
=
'
r
'
,
s
=
40
)
def
_plotOverlayLabels
(
self
,
overlay
,
opts
):
axis
=
self
.
getAxis
()
centre
=
np
.
array
(
overlay
.
shape
[:
3
])
/
2.0
for
ax
,
colour
in
zip
(
range
(
3
),
[
'
r
'
,
'
g
'
,
'
b
'
]):
voxSpan
=
np
.
vstack
((
centre
,
centre
))
voxSpan
[
0
,
ax
]
=
0
voxSpan
[
1
,
ax
]
=
overlay
.
shape
[
ax
]
orient
=
overlay
.
getVoxelOrientation
(
ax
)
lblLo
=
strings
.
anatomy
[
'
Image
'
,
'
lowshort
'
,
orient
]
lblHi
=
strings
.
anatomy
[
'
Image
'
,
'
highshort
'
,
orient
]
wldSpan
=
transform
.
transform
(
voxSpan
,
opts
.
getTransform
(
'
voxel
'
,
'
display
'
))
axis
.
plot
(
wldSpan
[:,
0
],
wldSpan
[:,
1
],
wldSpan
[:,
2
],
lw
=
2
,
color
=
colour
)
axis
.
text
(
wldSpan
[
0
,
0
],
wldSpan
[
0
,
1
],
wldSpan
[
0
,
2
],
lblLo
)
axis
.
text
(
wldSpan
[
1
,
0
],
wldSpan
[
1
,
1
],
wldSpan
[
1
,
2
],
lblHi
)
def
_plotAxisLengths
(
self
,
overlay
,
opts
):
axis
=
self
.
getAxis
()
xform
=
opts
.
getTransform
(
'
voxel
'
,
'
display
'
)
for
ax
,
colour
,
label
in
zip
(
range
(
3
),
[
'
r
'
,
'
g
'
,
'
b
'
],
[
'
X
'
,
'
Y
'
,
'
Z
'
]):
points
=
np
.
zeros
((
2
,
3
),
dtype
=
np
.
float32
)
points
[:]
=
[
-
0.5
,
-
0.5
,
-
0.5
]
points
[
1
,
ax
]
=
overlay
.
shape
[
ax
]
-
0.5
tx
=
transform
.
transform
(
points
,
xform
)
axlen
=
transform
.
axisLength
(
overlay
.
shape
,
xform
,
ax
)
axis
.
plot
(
tx
[:,
0
],
tx
[:,
1
],
tx
[:,
2
],
lw
=
1
,
color
=
colour
,
alpha
=
0.5
,
label
=
'
Axis {} (length {:0.2f})
'
.
format
(
label
,
axlen
))
def
_plotOverlayCorners
(
self
,
overlay
,
opts
):
x
,
y
,
z
=
overlay
.
shape
[:
3
]
x
=
x
-
0.5
y
=
y
-
0.5
z
=
z
-
0.5
points
=
np
.
zeros
((
8
,
3
),
dtype
=
np
.
float32
)
points
[
0
,
:]
=
[
-
0.5
,
-
0.5
,
-
0.5
]
points
[
1
,
:]
=
[
-
0.5
,
-
0.5
,
z
]
points
[
2
,
:]
=
[
-
0.5
,
y
,
-
0.5
]
points
[
3
,
:]
=
[
-
0.5
,
y
,
z
]
points
[
4
,
:]
=
[
x
,
-
0.5
,
-
0.5
]
points
[
5
,
:]
=
[
x
,
-
0.5
,
z
]
points
[
6
,
:]
=
[
x
,
y
,
-
0.5
]
points
[
7
,
:]
=
[
x
,
y
,
z
]
points
=
transform
.
transform
(
points
,
opts
.
getTransform
(
'
voxel
'
,
'
display
'
))
self
.
getAxis
().
scatter
(
points
[:,
0
],
points
[:,
1
],
points
[:,
2
],
color
=
'
b
'
,
s
=
40
)
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