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
Model registry
Operate
Environments
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
FSL
fslpy
Commits
c00cf46b
Commit
c00cf46b
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TimeSeriesPanel draws a vertical line at the current volume
parent
9e725973
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/fslview/views/timeseriespanel.py
+27
-9
27 additions, 9 deletions
fsl/fslview/views/timeseriespanel.py
with
27 additions
and
9 deletions
fsl/fslview/views/timeseriespanel.py
+
27
−
9
View file @
c00cf46b
...
...
@@ -42,21 +42,24 @@ class TimeSeriesPanel(wx.Panel, props.HasProperties):
'
selectedImage
'
,
self
.
_name
,
self
.
_selectedImageChanged
)
self
.
_imageList
.
addListener
(
'
location
'
,
self
.
_name
,
self
.
_locationChanged
)
self
.
_imageList
.
addListener
(
'
volume
'
,
self
.
_name
,
self
.
_locationChanged
)
def
onDestroy
(
ev
):
ev
.
Skip
()
self
.
_imageList
.
removeListener
(
'
selectedImage
'
,
self
.
_name
)
self
.
_imageList
.
removeListener
(
'
location
'
,
self
.
_name
)
self
.
_imageList
.
removeListener
(
'
volume
'
,
self
.
_name
)
self
.
Bind
(
wx
.
EVT_WINDOW_DESTROY
,
onDestroy
)
self
.
_selectedImageChanged
()
self
.
Layout
()
...
...
@@ -91,15 +94,30 @@ class TimeSeriesPanel(wx.Panel, props.HasProperties):
self
.
_voxPlot
(
image
,
*
self
.
_imageList
.
location
.
xyz
)
def
_voxPlot
(
self
,
image
,
x
,
y
,
z
):
x
,
y
,
z
=
image
.
worldToVox
([[
x
,
y
,
z
]])[
0
]
data
=
image
.
data
[
x
,
y
,
z
,
:]
print
print
'
Plot ({}, {}, {}): {}
'
.
format
(
x
,
y
,
z
,
data
)
print
t
=
self
.
_imageList
.
volume
inBounds
=
True
for
vox
,
shape
in
zip
((
x
,
y
,
z
),
image
.
shape
):
if
vox
>=
shape
or
vox
<
0
:
inBounds
=
False
if
inBounds
:
data
=
image
.
data
[
x
,
y
,
z
,
:]
self
.
_axis
.
plot
(
data
,
'
r-
'
,
lw
=
2
)
else
:
self
.
_axis
.
text
(
0.5
,
0.5
,
'
Out of bounds
'
,
color
=
'
#ff9090
'
,
ha
=
'
center
'
,
transform
=
self
.
_axis
.
transAxes
)
if
t
<
image
.
shape
[
3
]:
self
.
_axis
.
axvline
(
t
,
lw
=
2
,
c
=
'
#000080
'
)
self
.
_axis
.
plot
(
data
,
'
r-
'
,
lw
=
2
)
self
.
_canvas
.
draw
()
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