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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
d166f68c
Commit
d166f68c
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
_skip_* meta-properties are not documented.
parent
0948da9b
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
doc/conf.py
+15
-0
15 additions, 0 deletions
doc/conf.py
fsl/fsleyes/profiles/orthoeditprofile.py
+33
-35
33 additions, 35 deletions
fsl/fsleyes/profiles/orthoeditprofile.py
with
48 additions
and
35 deletions
doc/conf.py
+
15
−
0
View file @
d166f68c
...
...
@@ -348,3 +348,18 @@ autodoc_default_flags = ['private-members', 'special-members']
# Documentation for python modules is in the same order
# as the source code.
autodoc_member_order
=
'
bysource
'
def
autodoc_skip_member
(
app
,
what
,
name
,
obj
,
skip
,
options
):
# Do not document the _sync_* properties
# that are added by the props package to
# all SyncableHasProperties classes.
if
what
==
'
class
'
:
attName
=
name
.
split
(
'
.
'
)[
-
1
]
return
skip
or
attName
.
startswith
(
'
_sync_
'
)
return
skip
or
False
def
setup
(
app
):
app
.
connect
(
'
autodoc-skip-member
'
,
autodoc_skip_member
)
This diff is collapsed.
Click to expand it.
fsl/fsleyes/profiles/orthoeditprofile.py
+
33
−
35
View file @
d166f68c
...
...
@@ -73,8 +73,8 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
The ``OrthoEditProfile`` class uses :mod:`.annotations` on the
:class:`.SliceCanvas` panels displayed in the :class:`.OrthoPanel`,
to
display information to the user. Two annotations are used:
:class:`.SliceCanvas` panels
,
displayed in the :class:`.OrthoPanel`,
to
display information to the user. Two annotations are used:
- The *cursor* annotation. This is a :class:`.Rect` annotation
representing a cursor at the voxel, or voxels, underneath the
...
...
@@ -86,12 +86,12 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
selectionCursorColour
=
props
.
Colour
(
default
=
(
1
,
1
,
0
,
0.7
))
"""
Colour used for the
selection cursor
.
"""
"""
Colour used for the
cursor annotation
.
"""
selectionOverlayColour
=
props
.
Colour
(
default
=
(
1
,
0
,
1
,
0.7
))
"""
Colour used for the selection
overlay
, which displays the voxels
that
are currently selected.
"""
Colour used for the selection
annotation
, which displays the voxels
that
are currently selected.
"""
...
...
@@ -318,8 +318,7 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
"""
Called when either of the :attr:`selectionOverlayColour` or
:attr:`selectionCursorColour` properties change.
Updates the :class:`.SliceCanvas` :mod:`.annotations` colours
accordingly.
Updates the :mod:`.annotations` colours accordingly.
"""
if
self
.
__selAnnotation
is
not
None
:
self
.
__selAnnotation
.
colour
=
self
.
selectionOverlayColour
...
...
@@ -336,9 +335,8 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
"""
Called when either the :class:`.OverlayList` or
:attr:`.DisplayContext.selectedOverlay` change.
Destroys all old :class:`.SliceCanvas` :mod:`.annotations`. If the
newly selected overlay is an :class:`Image`, new annotations are
created.
Destroys all old :mod:`.annotations`. If the newly selected overlay is
an :class:`Image`, new annotations are created.
"""
overlay
=
self
.
_displayCtx
.
getSelectedOverlay
()
...
...
@@ -459,8 +457,8 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
return
np
.
int32
(
np
.
floor
(
voxel
))
def
__
makeSelection
Annotation
(
self
,
canvas
,
voxel
,
blockSize
=
None
):
"""
Highlights the specified voxel with a
def
__
drawCursor
Annotation
(
self
,
canvas
,
voxel
,
blockSize
=
None
):
"""
Draws the cursor annotation.
Highlights the specified voxel with a
:class:`~fsl.fsleyes.gl.annotations.Rect` annotation.
This is used by mouse motion event handlers, so the user can
...
...
@@ -469,8 +467,8 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
:arg canvas: The :class:`.SliceCanvas` on which to make the
annotation.
:arg voxel: Voxel which is at the centre of the
annotation
.
:arg blockSize: Size of the
annotation
square/cube.
:arg voxel: Voxel which is at the centre of the
cursor
.
:arg blockSize: Size of the
cursor
square/cube.
"""
opts
=
self
.
_displayCtx
.
getOpts
(
self
.
__currentOverlay
)
...
...
@@ -598,19 +596,19 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
elif
wheelDir
<
0
:
self
.
selectionSize
-=
1
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
)
def
_selModeMouseMove
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
"""
Handles mouse motion events in ``sel`` mode.
Draws a
selection
annotation at the current mouse location
(see :meth:`__
makeSelection
Annotation`).
Draws a
cursor
annotation at the current mouse location
(see :meth:`__
draweCursor
Annotation`).
"""
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
)
def
_selModeLeftMouseDown
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
...
...
@@ -622,9 +620,9 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
self
.
__editor
.
startChangeGroup
()
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
def
_selModeLeftMouseDrag
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
...
...
@@ -633,9 +631,9 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
Adds to the current :class:`Selection`.
"""
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
def
_selModeLeftMouseUp
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
...
...
@@ -675,9 +673,9 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
self
.
__editor
.
startChangeGroup
()
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
,
False
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
,
False
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
def
_deselModeLeftMouseDrag
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
...
...
@@ -686,9 +684,9 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
Removes from the current :class:`Selection`.
"""
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
,
False
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
self
.
__applySelection
(
canvas
,
voxel
,
False
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
)
self
.
__refreshCanvases
(
ev
,
canvas
,
mousePos
,
canvasPos
)
def
_deselModeLeftMouseUp
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
...
...
@@ -738,11 +736,11 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
def
_selintModeMouseMove
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
"""
Handles mouse motion events in ``selint`` mode. Draws a selection
annotation at the current location (see
:meth:`__
makeSelection
Annotation`).
:meth:`__
drawCursor
Annotation`).
"""
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
,
1
)
self
.
__refreshCanvases
(
ev
,
canvas
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
,
1
)
self
.
__refreshCanvases
(
ev
,
canvas
)
def
_selintModeLeftMouseDown
(
self
,
ev
,
canvas
,
mousePos
,
canvasPos
):
...
...
@@ -777,7 +775,7 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
if
not
self
.
limitToRadius
:
voxel
=
self
.
__getVoxelLocation
(
canvasPos
)
self
.
__
makeSelection
Annotation
(
canvas
,
voxel
,
1
)
self
.
__
drawCursor
Annotation
(
canvas
,
voxel
,
1
)
refreshArgs
=
(
ev
,
canvas
,
mousePos
,
canvasPos
)
...
...
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