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
ae8fd580
Commit
ae8fd580
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Holding shift down and dragging the mouse on an ortho canvas allows the
brightness/contrast of the current overlay to be adjusted.
parent
9477aeca
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/fsleyes/profiles/orthoviewprofile.py
+49
-16
49 additions, 16 deletions
fsl/fsleyes/profiles/orthoviewprofile.py
fsl/fsleyes/profiles/profilemap.py
+2
-1
2 additions, 1 deletion
fsl/fsleyes/profiles/profilemap.py
with
51 additions
and
17 deletions
fsl/fsleyes/profiles/orthoviewprofile.py
+
49
−
16
View file @
ae8fd580
...
@@ -24,24 +24,27 @@ class OrthoViewProfile(profiles.Profile):
...
@@ -24,24 +24,27 @@ class OrthoViewProfile(profiles.Profile):
allow the user to navigate through the ``OrthoPanel`` display of the
allow the user to navigate through the ``OrthoPanel`` display of the
overlays in the :class:`.OverlayList`.
overlays in the :class:`.OverlayList`.
``OrthoViewProfile`` defines th
ree
*modes* (see the
:class:`.Profile`
``OrthoViewProfile`` defines th
e following
*modes* (see the
class documentation):
:class:`.Profile`
class documentation):
======== ==============================================================
========
==
==============================================================
``nav`` The user can change the currently displayed location. This is
``nav``
The user can change the currently displayed location. This is
accomplished by updating the :attr:`.DisplayContext.location`
accomplished by updating the :attr:`.DisplayContext.location`
property on left mouse drags.
property on left mouse drags.
``zoom`` The user can zoom in/out of a canvas with the mouse wheel, and
``zoom``
The user can zoom in/out of a canvas with the mouse wheel, and
draw a rectangle on a canvas in which to zoom. This is
draw a rectangle on a canvas in which to zoom. This is
accomplished by updating the :attr:`.SliceCanvasOpts.zoom`
accomplished by updating the :attr:`.SliceCanvasOpts.zoom`
property on mouse wheel changes, and displaying a
property on mouse wheel changes, and displaying a
:class:`~.annotations.Rect` annotation on left mouse drags.
:class:`~.annotations.Rect` annotation on left mouse drags.
``pan`` The user can pan around a canvas (if the canvas is zoomed in).
``pan`` The user can pan around a canvas (if the canvas is zoomed in).
This is accomplished by calling the
This is accomplished by calling the
:meth:`.SliceCanvas.panDisplayBy` on left mouse drags.
:meth:`.SliceCanvas.panDisplayBy` on left mouse drags.
======== ==============================================================
``bricon`` The user can drag the mouse along a canvas to change the
brightness/contrast of the currently selected overlay.
========== ==============================================================
The ``OrthoViewProfile`` class also defines a few actions:
The ``OrthoViewProfile`` class also defines a few actions:
...
@@ -86,7 +89,7 @@ class OrthoViewProfile(profiles.Profile):
...
@@ -86,7 +89,7 @@ class OrthoViewProfile(profiles.Profile):
if
extraModes
is
None
:
extraModes
=
[]
if
extraModes
is
None
:
extraModes
=
[]
if
extraActions
is
None
:
extraActions
=
{}
if
extraActions
is
None
:
extraActions
=
{}
modes
=
[
'
nav
'
,
'
pan
'
,
'
zoom
'
]
modes
=
[
'
nav
'
,
'
pan
'
,
'
zoom
'
,
'
bricon
'
]
actionz
=
{
actionz
=
{
'
resetZoom
'
:
self
.
resetZoom
,
'
resetZoom
'
:
self
.
resetZoom
,
'
centreCursor
'
:
self
.
centreCursor
,
'
centreCursor
'
:
self
.
centreCursor
,
...
@@ -424,3 +427,33 @@ class OrthoViewProfile(profiles.Profile):
...
@@ -424,3 +427,33 @@ class OrthoViewProfile(profiles.Profile):
else
:
return
else
:
return
canvas
.
panDisplayBy
(
xoff
,
yoff
)
canvas
.
panDisplayBy
(
xoff
,
yoff
)
def
_briconModeLeftMouseDrag
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
"""
Handles left mouse drags in ``bricon`` mode.
The brightness and contrast of the currently selected overlay are
adjusted according to the location of the mouse, relative to the
canvas.
"""
overlay
=
self
.
_displayCtx
.
getSelectedOverlay
()
if
overlay
is
None
:
return
display
=
self
.
_displayCtx
.
getDisplay
(
overlay
)
w
,
h
=
canvas
.
GetSize
().
Get
()
x
,
y
=
mousePos
brightness
=
float
(
x
)
/
w
contrast
=
float
(
y
)
/
h
log
.
debug
(
'
Adjusting bricon for {}
'
'
(brightness: {}, contrast: {})
'
.
format
(
overlay
.
name
,
brightness
,
contrast
))
display
.
brightness
=
100
*
brightness
display
.
contrast
=
100
*
contrast
This diff is collapsed.
Click to expand it.
fsl/fsleyes/profiles/profilemap.py
+
2
−
1
View file @
ae8fd580
...
@@ -68,7 +68,8 @@ tempModeMap = {
...
@@ -68,7 +68,8 @@ tempModeMap = {
((
'
nav
'
,
wx
.
WXK_CONTROL
),
'
zoom
'
),
((
'
nav
'
,
wx
.
WXK_CONTROL
),
'
zoom
'
),
((
'
pan
'
,
wx
.
WXK_CONTROL
),
'
zoom
'
),
((
'
pan
'
,
wx
.
WXK_CONTROL
),
'
zoom
'
),
((
'
nav
'
,
wx
.
WXK_ALT
),
'
pan
'
),
((
'
nav
'
,
wx
.
WXK_ALT
),
'
pan
'
),
((
'
zoom
'
,
wx
.
WXK_ALT
),
'
pan
'
))),
((
'
zoom
'
,
wx
.
WXK_ALT
),
'
pan
'
),
((
'
nav
'
,
wx
.
WXK_SHIFT
),
'
bricon
'
))),
# OrthoEditProfile inherits all of the
# OrthoEditProfile inherits all of the
# settings for OrthoViewProfile above,
# settings for OrthoViewProfile above,
...
...
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