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
7c23a801
Commit
7c23a801
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Updated getDisplayBounds methods for GLObject types, and moved globject
<-> overlay type map to a module-level attribute.
parent
acc83cba
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/fslview/gl/glmodel.py
+1
-1
1 addition, 1 deletion
fsl/fslview/gl/glmodel.py
fsl/fslview/gl/globject.py
+21
-15
21 additions, 15 deletions
fsl/fslview/gl/globject.py
with
22 additions
and
16 deletions
fsl/fslview/gl/glmodel.py
+
1
−
1
View file @
7c23a801
...
...
@@ -30,7 +30,7 @@ class GLModel(globject.GLObject):
def
getDisplayBounds
(
self
):
return
self
.
o
verlay
.
get
Bounds
()
return
self
.
o
pts
.
getDisplay
Bounds
()
def
setAxes
(
self
,
xax
,
yax
):
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/gl/globject.py
+
21
−
15
View file @
7c23a801
...
...
@@ -15,6 +15,25 @@ representation.
import
numpy
as
np
import
glvolume
import
glmask
import
glrgbvector
import
gllinevector
import
glmodel
GLOBJECT_OVERLAY_TYPE_MAP
=
{
'
volume
'
:
glvolume
.
GLVolume
,
'
mask
'
:
glmask
.
GLMask
,
'
rgbvector
'
:
glrgbvector
.
GLRGBVector
,
'
linevector
'
:
gllinevector
.
GLLineVector
,
'
model
'
:
glmodel
.
GLModel
}
"""
This dictionary provides a mapping between all available overlay types (see
the :attr:`.Display.overlayType` property), and the :class:`GLObject` subclass
used to represent them.
"""
def
createGLObject
(
overlay
,
display
):
"""
Create :class:`GLObject` instance for the given overlay, as specified
...
...
@@ -25,20 +44,7 @@ def createGLObject(overlay, display):
:arg display: A :class:`.Display` instance describing how the overlay
should be displayed.
"""
import
fsl.fslview.gl.glvolume
as
glvolume
import
fsl.fslview.gl.glmask
as
glmask
import
fsl.fslview.gl.glrgbvector
as
glrgbvector
import
fsl.fslview.gl.gllinevector
as
gllinevector
_objectmap
=
{
'
volume
'
:
glvolume
.
GLVolume
,
'
mask
'
:
glmask
.
GLMask
,
'
rgbvector
'
:
glrgbvector
.
GLRGBVector
,
'
linevector
'
:
gllinevector
.
GLLineVector
}
ctr
=
_objectmap
.
get
(
display
.
overlayType
,
None
)
ctr
=
GLOBJECT_OVERLAY_TYPE_MAP
.
get
(
display
.
overlayType
,
None
)
if
ctr
is
not
None
:
return
ctr
(
overlay
,
display
)
else
:
return
None
...
...
@@ -225,7 +231,7 @@ class GLImageObject(GLObject):
def
getDisplayBounds
(
self
):
return
self
.
display
.
getDisplayBounds
()
return
self
.
display
Opts
.
getDisplayBounds
()
def
getDataResolution
(
self
,
xax
,
yax
):
...
...
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