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
1adb5288
Commit
1adb5288
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
HistogramSeries fixed - props.enable/disableListener now throws errors
if said listener is not registered.
parent
416f4d06
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/plotting/__init__.py
+7
-1
7 additions, 1 deletion
fsl/fsleyes/plotting/__init__.py
fsl/fsleyes/plotting/histogramseries.py
+11
-5
11 additions, 5 deletions
fsl/fsleyes/plotting/histogramseries.py
with
18 additions
and
6 deletions
fsl/fsleyes/plotting/__init__.py
+
7
−
1
View file @
1adb5288
#!/usr/bin/env python
#
# __init__.py -
# __init__.py -
Classes used by PlotPanel.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""
The ``plotting`` package contains the :class:`.DataSeries` class, and
all of its sub-classes. These classes are used by :class:`.PlotPanel` views
for plotting data.
"""
import
dataseries
import
timeseries
import
histogramseries
DataSeries
=
dataseries
.
DataSeries
TimeSeries
=
timeseries
.
TimeSeries
...
...
@@ -17,3 +22,4 @@ FEATEVTimeSeries = timeseries.FEATEVTimeSeries
FEATResidualTimeSeries
=
timeseries
.
FEATResidualTimeSeries
FEATModelFitTimeSeries
=
timeseries
.
FEATModelFitTimeSeries
MelodicTimeSeries
=
timeseries
.
MelodicTimeSeries
HistogramSeries
=
histogramseries
.
HistogramSeries
This diff is collapsed.
Click to expand it.
fsl/fsleyes/plotting/histogramseries.py
+
11
−
5
View file @
1adb5288
#!/usr/bin/env python
#
# histogramseries.py -
# histogramseries.py -
The HistogramSeries class.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""
This module provides the :class:`HistogramSeries` class, used by the
:class:`.HistogramPanel` for plotting histogram data.
"""
import
logging
...
...
@@ -23,6 +26,7 @@ class HistogramSeries(dataseries.DataSeries):
instance.
"""
nbins
=
props
.
Int
(
minval
=
10
,
maxval
=
500
,
default
=
100
,
clamped
=
True
)
"""
Number of bins to use in the histogram. This value is overridden
by the :attr:`HistogramPanel.autoBin` setting.
...
...
@@ -110,7 +114,7 @@ class HistogramSeries(dataseries.DataSeries):
if
overlay
.
is4DImage
():
self
.
setConstraint
(
'
volume
'
,
'
maxval
'
,
overlay
.
shape
[
3
]
-
1
)
# If we have a baseHS, we
# can copy all its data
if
baseHs
is
not
None
:
...
...
@@ -134,7 +138,7 @@ class HistogramSeries(dataseries.DataSeries):
# it all for ourselves
else
:
self
.
__initProperties
()
overlayList
.
addListener
(
'
overlays
'
,
self
.
__name
,
self
.
__overlayListChanged
)
...
...
@@ -317,9 +321,11 @@ class HistogramSeries(dataseries.DataSeries):
if
self
.
__hsPanel
.
autoBin
:
nbins
=
self
.
__autoBin
(
data
,
self
.
dataRange
.
x
)
self
.
disableListener
(
'
nbins
'
,
self
.
__name
)
if
self
.
hasListener
(
'
nbins
'
,
self
.
__name
):
self
.
disableListener
(
'
nbins
'
,
self
.
__name
)
self
.
nbins
=
nbins
self
.
enableListener
(
'
nbins
'
,
self
.
__name
)
if
self
.
hasListener
(
'
nbins
'
,
self
.
__name
):
self
.
enableListener
(
'
nbins
'
,
self
.
__name
)
# Calculate bin edges
bins
=
np
.
linspace
(
self
.
dataRange
.
xlo
,
...
...
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