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
ee44e37a
Commit
ee44e37a
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Movie mode property on CanvasPanel
parent
826a49d2
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
+2
-0
2 additions, 0 deletions
fsl/data/strings.py
fsl/fslview/controls/canvassettingspanel.py
+3
-1
3 additions, 1 deletion
fsl/fslview/controls/canvassettingspanel.py
fsl/fslview/views/canvaspanel.py
+67
-5
67 additions, 5 deletions
fsl/fslview/views/canvaspanel.py
with
72 additions
and
6 deletions
fsl/data/strings.py
+
2
−
0
View file @
ee44e37a
...
...
@@ -282,6 +282,8 @@ properties = TypeDict({
'
CanvasPanel.syncLocation
'
:
'
Sync location
'
,
'
CanvasPanel.syncOverlayOrder
'
:
'
Sync overlay order
'
,
'
CanvasPanel.syncOverlayDisplay
'
:
'
Sync overlay display settings
'
,
'
CanvasPanel.movieMode
'
:
'
Movie mode
'
,
'
CanvasPanel.movieRate
'
:
'
Movie update rate
'
,
'
CanvasPanel.profile
'
:
'
Mode
'
,
'
SceneOpts.showCursor
'
:
'
Show location cursor
'
,
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/controls/canvassettingspanel.py
+
3
−
1
View file @
ee44e37a
...
...
@@ -21,7 +21,9 @@ _CANVASPANEL_PROPS = [
visibleWhen
=
lambda
i
:
len
(
i
.
getProp
(
'
profile
'
).
getChoices
(
i
))
>
1
),
props
.
Widget
(
'
syncOverlayOrder
'
),
props
.
Widget
(
'
syncLocation
'
),
props
.
Widget
(
'
syncOverlayDisplay
'
)
props
.
Widget
(
'
syncOverlayDisplay
'
),
props
.
Widget
(
'
movieMode
'
),
props
.
Widget
(
'
movieRate
'
,
spin
=
False
,
showLimits
=
False
),
]
_SCENEOPTS_PROPS
=
[
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/views/canvaspanel.py
+
67
−
5
View file @
ee44e37a
...
...
@@ -167,6 +167,12 @@ class CanvasPanel(viewpanel.ViewPanel):
syncLocation
=
props
.
Boolean
(
default
=
True
)
syncOverlayOrder
=
props
.
Boolean
(
default
=
True
)
syncOverlayDisplay
=
props
.
Boolean
(
default
=
True
)
movieMode
=
props
.
Boolean
(
default
=
False
)
movieRate
=
props
.
Int
(
minval
=
100
,
maxval
=
2000
,
default
=
250
,
clamped
=
True
)
def
__init__
(
self
,
parent
,
...
...
@@ -224,6 +230,17 @@ class CanvasPanel(viewpanel.ViewPanel):
self
.
setCentrePanel
(
self
.
__canvasContainer
)
# Stores a reference to a wx.Timer
# when movie mode is enabled
self
.
__movieTimer
=
None
self
.
addListener
(
'
movieMode
'
,
self
.
_name
,
self
.
__movieModeChanged
)
self
.
addListener
(
'
movieRate
'
,
self
.
_name
,
self
.
__movieRateChanged
)
# Canvas/colour bar layout is managed in
# the _layout/_toggleColourBar methods
self
.
__canvasSizer
=
None
...
...
@@ -238,10 +255,6 @@ class CanvasPanel(viewpanel.ViewPanel):
self
.
__layout
()
def
getSceneOptions
(
self
):
return
self
.
__opts
def
destroy
(
self
):
"""
Makes sure that any remaining control panels are destroyed
cleanly.
...
...
@@ -251,7 +264,11 @@ class CanvasPanel(viewpanel.ViewPanel):
self
.
__colourBar
.
destroy
()
viewpanel
.
ViewPanel
.
destroy
(
self
)
def
getSceneOptions
(
self
):
return
self
.
__opts
def
screenshot
(
self
,
*
a
):
_takeScreenShot
(
self
.
_overlayList
,
self
.
_displayCtx
,
self
)
...
...
@@ -313,3 +330,48 @@ class CanvasPanel(viewpanel.ViewPanel):
# Force the canvas panel to resize itself
self
.
PostSizeEvent
()
def
__movieModeChanged
(
self
,
*
a
):
if
self
.
__movieTimer
is
not
None
:
self
.
__movieTimer
.
Stop
()
self
.
__movieTimer
=
None
if
not
self
.
movieMode
:
return
self
.
__movieTimer
=
wx
.
Timer
(
self
)
self
.
Bind
(
wx
.
EVT_TIMER
,
self
.
__movieUpdate
)
self
.
__movieTimer
.
Start
(
self
.
movieRate
)
def
__movieRateChanged
(
self
,
*
a
):
if
not
self
.
movieMode
:
return
self
.
__movieModeChanged
()
def
__movieUpdate
(
self
,
ev
):
overlay
=
self
.
_displayCtx
.
getSelectedOverlay
()
if
overlay
is
None
:
return
if
not
isinstance
(
overlay
,
fslimage
.
Image
):
return
if
not
overlay
.
is4DImage
():
return
opts
=
self
.
_displayCtx
.
getOpts
(
overlay
)
if
not
isinstance
(
opts
,
displayctx
.
VolumeOpts
):
return
limit
=
overlay
.
shape
[
3
]
if
opts
.
volume
==
limit
-
1
:
opts
.
volume
=
0
else
:
opts
.
volume
+=
1
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