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
16827f06
Commit
16827f06
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
posSync property on LightBoxPanel, which enables/disables
synchronisation between lightbox position and image list position
parent
22c56d6e
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/lightboxpanel.py
+40
-9
40 additions, 9 deletions
fsl/fslview/views/lightboxpanel.py
with
40 additions
and
9 deletions
fsl/fslview/views/lightboxpanel.py
+
40
−
9
View file @
16827f06
#!/usr/bin/env python
#!/usr/bin/env python
#
#
# lightboxpanel.py -
# lightboxpanel.py - A panel which contains a LightBoxCanvas, for displaying
# multiple slices from a collection of images.
#
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
#
"""
This module defines the :class:`LightBoxPanel, a panel which contains a
:class:`~fsl.fslview.gl.LightBoxCanvas`, for displaying multiple slices from a
collection of images.
"""
import
logging
import
logging
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -14,11 +19,12 @@ import props
...
@@ -14,11 +19,12 @@ import props
import
fsl.fslview.gl.lightboxcanvas
as
lightboxcanvas
import
fsl.fslview.gl.lightboxcanvas
as
lightboxcanvas
class
LightBoxPanel
(
wx
.
Panel
,
props
.
HasProperties
):
class
LightBoxPanel
(
wx
.
Panel
,
props
.
HasProperties
):
"""
"""
Convenience Panel which contains a
Convenience Panel which contains a a
LightBoxCanvas and a scrollbar,
:class:`~fsl.fslview.gl.
LightBoxCanvas
`
and a scrollbar,
and sets up
and sets up
mouse-scrolling behaviour.
mouse-scrolling behaviour.
"""
"""
sliceSpacing
=
lightboxcanvas
.
LightBoxCanvas
.
sliceSpacing
sliceSpacing
=
lightboxcanvas
.
LightBoxCanvas
.
sliceSpacing
"""
See :attr:`fsl.fslview.gl.lightboxcanvas.LightBoxCanvas.sliceSpacing`.
"""
See :attr:`fsl.fslview.gl.lightboxcanvas.LightBoxCanvas.sliceSpacing`.
"""
"""
...
@@ -39,12 +45,33 @@ class LightBoxPanel(wx.Panel, props.HasProperties):
...
@@ -39,12 +45,33 @@ class LightBoxPanel(wx.Panel, props.HasProperties):
"""
See :attr:`fsl.fslview.gl.slicecanvas.SliceCanvas.zax`.
"""
"""
See :attr:`fsl.fslview.gl.slicecanvas.SliceCanvas.zax`.
"""
_labels
=
lightboxcanvas
.
LightBoxCanvas
.
_labels
posSync
=
props
.
Boolean
(
default
=
True
)
"""
See :attr:`fsl.fslview.gl.slicecanvas.SliceCanvas._labels`.
"""
"""
If False, the cursor position shown in the
:class:`fsl.fslview.gl.lightboxcanvas.LightBoxCanvas` instance, which
is contained in this :class:`LightBoxPanel` (the
:attr:`~fsl.fslview.gl.slicecanvas.SliceCanvas.pos` property) will not
be synchronised to the :class:`~fsl.data.fslimage.ImageList.location`
:attr:`~fsl.data.fslimage.ImageList.location` property.
"""
_labels
=
{
'
zrange
'
:
'
Slice range
'
,
'
posSync
'
:
'
Synchronise position
'
,
'
sliceSpacing
'
:
'
Slice spacing
'
,
'
ncols
'
:
'
Number of columns
'
,
'
showCursor
'
:
'
Show cursor
'
,
'
zax
'
:
'
Z axis
'
}
"""
Property labels to be used for GUI displays.
"""
_view
=
lightboxcanvas
.
LightBoxCanvas
.
_view
_view
=
props
.
VGroup
((
'
showCursor
'
,
"""
See :attr:`fsl.fslview.gl.slicecanvas.SliceCanvas._view`.
"""
'
posSync
'
,
'
zrange
'
,
'
sliceSpacing
'
,
'
ncols
'
,
'
zax
'
))
"""
Layout to be used for GUI displays.
"""
def
__init__
(
self
,
parent
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
parent
,
*
args
,
**
kwargs
):
...
@@ -84,6 +111,7 @@ class LightBoxPanel(wx.Panel, props.HasProperties):
...
@@ -84,6 +111,7 @@ class LightBoxPanel(wx.Panel, props.HasProperties):
self
.
Bind
(
wx
.
EVT_MOUSEWHEEL
,
self
.
onMouseScroll
)
self
.
Bind
(
wx
.
EVT_MOUSEWHEEL
,
self
.
onMouseScroll
)
def
move
(
*
a
):
def
move
(
*
a
):
if
not
self
.
posSync
:
return
xpos
=
self
.
imageList
.
location
.
getPos
(
self
.
canvas
.
xax
)
xpos
=
self
.
imageList
.
location
.
getPos
(
self
.
canvas
.
xax
)
ypos
=
self
.
imageList
.
location
.
getPos
(
self
.
canvas
.
yax
)
ypos
=
self
.
imageList
.
location
.
getPos
(
self
.
canvas
.
yax
)
zpos
=
self
.
imageList
.
location
.
getPos
(
self
.
canvas
.
zax
)
zpos
=
self
.
imageList
.
location
.
getPos
(
self
.
canvas
.
zax
)
...
@@ -121,7 +149,10 @@ class LightBoxPanel(wx.Panel, props.HasProperties):
...
@@ -121,7 +149,10 @@ class LightBoxPanel(wx.Panel, props.HasProperties):
'
({}, {} -> {: 5.2f}, {: 5.2f}, {: 5.2f})
'
.
format
(
'
({}, {} -> {: 5.2f}, {: 5.2f}, {: 5.2f})
'
.
format
(
self
.
canvas
.
name
,
mx
,
my
,
xpos
,
ypos
,
zpos
))
self
.
canvas
.
name
,
mx
,
my
,
xpos
,
ypos
,
zpos
))
self
.
imageList
.
location
.
xyz
=
xpos
,
ypos
,
zpos
self
.
canvas
.
pos
.
xyz
=
(
xpos
,
ypos
,
zpos
)
if
self
.
posSync
:
self
.
imageList
.
location
.
xyz
=
xpos
,
ypos
,
zpos
def
onMouseScroll
(
self
,
ev
):
def
onMouseScroll
(
self
,
ev
):
...
...
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