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
6fc9c2ce
Commit
6fc9c2ce
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
New VolumeOpts to link low/high display/clipping ranges together.
parent
1eb2fe41
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/fsleyes/controls/overlaydisplaypanel.py
+4
-1
4 additions, 1 deletion
fsl/fsleyes/controls/overlaydisplaypanel.py
fsl/fsleyes/displaycontext/volumeopts.py
+70
-2
70 additions, 2 deletions
fsl/fsleyes/displaycontext/volumeopts.py
with
76 additions
and
3 deletions
fsl/data/strings.py
+
2
−
0
View file @
6fc9c2ce
...
@@ -507,6 +507,8 @@ properties = TypeDict({
...
@@ -507,6 +507,8 @@ properties = TypeDict({
'
VolumeOpts.displayRange
'
:
'
Display range
'
,
'
VolumeOpts.displayRange
'
:
'
Display range
'
,
'
VolumeOpts.clippingRange
'
:
'
Clipping range
'
,
'
VolumeOpts.clippingRange
'
:
'
Clipping range
'
,
'
VolumeOpts.centreRanges
'
:
'
Centre display/clipping ranges at 0
'
,
'
VolumeOpts.centreRanges
'
:
'
Centre display/clipping ranges at 0
'
,
'
VolumeOpts.linkLowRanges
'
:
'
Link low display/clipping ranges
'
,
'
VolumeOpts.linkHighRanges
'
:
'
Link high display/clipping ranges
'
,
'
VolumeOpts.cmap
'
:
'
Colour map
'
,
'
VolumeOpts.cmap
'
:
'
Colour map
'
,
'
VolumeOpts.invert
'
:
'
Invert colour map
'
,
'
VolumeOpts.invert
'
:
'
Invert colour map
'
,
'
VolumeOpts.invertClipping
'
:
'
Invert clipping range
'
,
'
VolumeOpts.invertClipping
'
:
'
Invert clipping range
'
,
...
...
This diff is collapsed.
Click to expand it.
fsl/fsleyes/controls/overlaydisplaypanel.py
+
4
−
1
View file @
6fc9c2ce
...
@@ -207,7 +207,8 @@ class OverlayDisplayPanel(fslpanel.FSLEyesPanel):
...
@@ -207,7 +207,8 @@ class OverlayDisplayPanel(fslpanel.FSLEyesPanel):
self
.
__widgets
.
ClearGroup
(
groupName
)
self
.
__widgets
.
ClearGroup
(
groupName
)
dispProps
=
_DISPLAY_PROPS
[
target
]
dispProps
=
_DISPLAY_PROPS
[
target
]
labels
=
[
strings
.
properties
[
target
,
p
.
key
]
for
p
in
dispProps
]
labels
=
[
strings
.
properties
.
get
((
target
,
p
.
key
),
p
.
key
)
for
p
in
dispProps
]
tooltips
=
[
fsltooltips
.
properties
.
get
((
target
,
p
.
key
),
None
)
tooltips
=
[
fsltooltips
.
properties
.
get
((
target
,
p
.
key
),
None
)
for
p
in
dispProps
]
for
p
in
dispProps
]
...
@@ -289,6 +290,8 @@ _DISPLAY_PROPS = td.TypeDict({
...
@@ -289,6 +290,8 @@ _DISPLAY_PROPS = td.TypeDict({
props
.
Widget
(
'
invert
'
),
props
.
Widget
(
'
invert
'
),
props
.
Widget
(
'
invertClipping
'
),
props
.
Widget
(
'
invertClipping
'
),
props
.
Widget
(
'
centreRanges
'
),
props
.
Widget
(
'
centreRanges
'
),
props
.
Widget
(
'
linkLowRanges
'
),
props
.
Widget
(
'
linkHighRanges
'
),
props
.
Widget
(
'
displayRange
'
,
props
.
Widget
(
'
displayRange
'
,
showLimits
=
False
,
showLimits
=
False
,
slider
=
True
,
slider
=
True
,
...
...
This diff is collapsed.
Click to expand it.
fsl/fsleyes/displaycontext/volumeopts.py
+
70
−
2
View file @
6fc9c2ce
...
@@ -506,8 +506,26 @@ class VolumeOpts(ImageOpts):
...
@@ -506,8 +506,26 @@ class VolumeOpts(ImageOpts):
"""
If ``True``, the :attr:`displayRange` and :attr:`clippingRange` ranges
"""
If ``True``, the :attr:`displayRange` and :attr:`clippingRange` ranges
will be kept centred at zero. A change to the negative end of either range
will be kept centred at zero. A change to the negative end of either range
will result in the positive end being changed, and vice versa.
will result in the positive end being changed, and vice versa.
.. note:: When this property is set to ``True``, the
:attr:`.Display.brightness`, :attr:`.Display.contrast`,
:attr:`.linkLowRanges` and :attr:`.linkHighRanges` properties
are all disabled, as managing the interaction between all of
them would be far too complicated.
"""
linkLowRanges
=
props
.
Boolean
(
default
=
False
)
"""
If ``True``, the low bounds on both the :attr:`displayRange` and
:attr:`clippingRange` ranges will be linked together.
"""
"""
linkHighRanges
=
props
.
Boolean
(
default
=
False
)
"""
If ``True``, the high bounds on both the :attr:`displayRange` and
:attr:`clippingRange` ranges will be linked together.
"""
def
__init__
(
self
,
def
__init__
(
self
,
overlay
,
overlay
,
...
@@ -560,7 +578,8 @@ class VolumeOpts(ImageOpts):
...
@@ -560,7 +578,8 @@ class VolumeOpts(ImageOpts):
self
.
displayRange
.
xmin
=
self
.
dataMin
-
10
*
dRangeLen
self
.
displayRange
.
xmin
=
self
.
dataMin
-
10
*
dRangeLen
self
.
displayRange
.
xmax
=
self
.
dataMax
+
10
*
dRangeLen
self
.
displayRange
.
xmax
=
self
.
dataMax
+
10
*
dRangeLen
self
.
setConstraint
(
'
displayRange
'
,
'
minDistance
'
,
dMinDistance
)
self
.
setConstraint
(
'
displayRange
'
,
'
minDistance
'
,
dMinDistance
)
self
.
setConstraint
(
'
clippingRange
'
,
'
minDistance
'
,
dMinDistance
)
ImageOpts
.
__init__
(
self
,
ImageOpts
.
__init__
(
self
,
overlay
,
overlay
,
...
@@ -581,7 +600,13 @@ class VolumeOpts(ImageOpts):
...
@@ -581,7 +600,13 @@ class VolumeOpts(ImageOpts):
self
.
__displayRangeChanged
)
self
.
__displayRangeChanged
)
self
.
addListener
(
'
centreRanges
'
,
self
.
addListener
(
'
centreRanges
'
,
self
.
name
,
self
.
name
,
self
.
__centreRangesChanged
)
self
.
__centreRangesChanged
)
self
.
addListener
(
'
linkLowRanges
'
,
self
.
name
,
self
.
__linkLowRangesChanged
)
self
.
addListener
(
'
linkHighRanges
'
,
self
.
name
,
self
.
__linkHighRangesChanged
)
# Because displayRange and bri/con are intrinsically
# Because displayRange and bri/con are intrinsically
# linked, it makes no sense to let the user sync/unsync
# linked, it makes no sense to let the user sync/unsync
...
@@ -722,13 +747,56 @@ class VolumeOpts(ImageOpts):
...
@@ -722,13 +747,56 @@ class VolumeOpts(ImageOpts):
"""
"""
if
self
.
centreRanges
:
if
self
.
centreRanges
:
self
.
linkLowRanges
=
False
self
.
linkHighRanges
=
False
self
.
display
.
disableProperty
(
'
brightness
'
)
self
.
display
.
disableProperty
(
'
brightness
'
)
self
.
display
.
disableProperty
(
'
contrast
'
)
self
.
display
.
disableProperty
(
'
contrast
'
)
self
.
disableProperty
(
'
linkLowRanges
'
)
self
.
disableProperty
(
'
linkHighRanges
'
)
self
.
setConstraint
(
'
displayRange
'
,
'
dimCentres
'
,
[
0.0
])
self
.
setConstraint
(
'
displayRange
'
,
'
dimCentres
'
,
[
0.0
])
self
.
setConstraint
(
'
clippingRange
'
,
'
dimCentres
'
,
[
0.0
])
self
.
setConstraint
(
'
clippingRange
'
,
'
dimCentres
'
,
[
0.0
])
else
:
else
:
self
.
display
.
enableProperty
(
'
brightness
'
)
self
.
display
.
enableProperty
(
'
brightness
'
)
self
.
display
.
enableProperty
(
'
contrast
'
)
self
.
display
.
enableProperty
(
'
contrast
'
)
self
.
enableProperty
(
'
linkLowRanges
'
)
self
.
enableProperty
(
'
linkHighRanges
'
)
self
.
setConstraint
(
'
displayRange
'
,
'
dimCentres
'
,
[
None
])
self
.
setConstraint
(
'
displayRange
'
,
'
dimCentres
'
,
[
None
])
self
.
setConstraint
(
'
clippingRange
'
,
'
dimCentres
'
,
[
None
])
self
.
setConstraint
(
'
clippingRange
'
,
'
dimCentres
'
,
[
None
])
def
__linkLowRangesChanged
(
self
,
*
a
):
"""
Called when the :attr:`linkLowRanges` property changes. Calls the
:meth:`__linkRangesChanged` method.
"""
self
.
__linkRangesChanged
(
self
.
linkLowRanges
,
0
)
def
__linkHighRangesChanged
(
self
,
*
a
):
"""
Called when the :attr:`linkHighRanges` property changes. Calls the
:meth:`__linkRangesChanged` method.
"""
self
.
__linkRangesChanged
(
self
.
linkHighRanges
,
1
)
def
__linkRangesChanged
(
self
,
val
,
idx
):
"""
Called when either the :attr:`linkLowRanges` or
:attr:`linkHighRanges` properties change. Binds/unbinds the specified
range properties together.
:arg val: Boolean indicating whether the range values should be
linked or unlinked.
:arg idx: Range value index - 0 corresponds to the low range value,
and 1 to the high range value.
"""
dRangePVs
=
self
.
displayRange
.
getPropertyValueList
()
cRangePVs
=
self
.
clippingRange
.
getPropertyValueList
()
props
.
bindPropVals
(
dRangePVs
[
idx
],
cRangePVs
[
idx
],
bindval
=
True
,
bindatt
=
False
,
unbind
=
not
val
)
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