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
3b60dc74
Commit
3b60dc74
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Added a bunch of edge-cases for bad plot data
parent
ac573ec4
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/views/histogrampanel.py
+6
-0
6 additions, 0 deletions
fsl/fslview/views/histogrampanel.py
fsl/fslview/views/plotpanel.py
+13
-0
13 additions, 0 deletions
fsl/fslview/views/plotpanel.py
with
19 additions
and
0 deletions
fsl/fslview/views/histogrampanel.py
+
6
−
0
View file @
3b60dc74
...
@@ -215,6 +215,12 @@ class HistogramSeries(plotpanel.DataSeries):
...
@@ -215,6 +215,12 @@ class HistogramSeries(plotpanel.DataSeries):
log
.
debug
(
'
Calculating histogram for
'
log
.
debug
(
'
Calculating histogram for
'
'
overlay {}
'
.
format
(
self
.
overlay
.
name
))
'
overlay {}
'
.
format
(
self
.
overlay
.
name
))
if
self
.
dataRange
.
xhi
-
self
.
dataRange
.
xlo
<
0.00000001
:
self
.
xdata
=
np
.
array
([])
self
.
ydata
=
np
.
array
([])
self
.
nvals
=
0
return
if
self
.
ignoreZeros
:
if
self
.
ignoreZeros
:
if
self
.
includeOutliers
:
data
=
self
.
nonZeroData
if
self
.
includeOutliers
:
data
=
self
.
nonZeroData
else
:
data
=
self
.
clippedNonZeroData
else
:
data
=
self
.
clippedNonZeroData
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/views/plotpanel.py
+
13
−
0
View file @
3b60dc74
...
@@ -196,6 +196,13 @@ class PlotPanel(viewpanel.ViewPanel):
...
@@ -196,6 +196,13 @@ class PlotPanel(viewpanel.ViewPanel):
(
xmin
,
xmax
),
(
ymin
,
ymax
)
=
self
.
__calcLimits
(
xlims
,
ylims
)
(
xmin
,
xmax
),
(
ymin
,
ymax
)
=
self
.
__calcLimits
(
xlims
,
ylims
)
if
xmax
-
xmin
<
0.0000000001
or
\
ymax
-
ymin
<
0.0000000001
:
axis
.
clear
()
canvas
.
draw
()
self
.
Refresh
()
return
# x/y axis labels
# x/y axis labels
xlabel
=
self
.
xlabel
xlabel
=
self
.
xlabel
ylabel
=
self
.
ylabel
ylabel
=
self
.
ylabel
...
@@ -269,6 +276,9 @@ class PlotPanel(viewpanel.ViewPanel):
...
@@ -269,6 +276,9 @@ class PlotPanel(viewpanel.ViewPanel):
xdata
,
ydata
=
ds
.
getData
()
xdata
,
ydata
=
ds
.
getData
()
if
len
(
xdata
)
!=
len
(
ydata
)
or
len
(
xdata
)
==
0
:
return
(
0
,
0
),
(
0
,
0
)
# Note to self: If the smoothed data is
# Note to self: If the smoothed data is
# filled with NaNs, it is possibly due
# filled with NaNs, it is possibly due
# to duplicate values in the x data, which
# to duplicate values in the x data, which
...
@@ -290,6 +300,9 @@ class PlotPanel(viewpanel.ViewPanel):
...
@@ -290,6 +300,9 @@ class PlotPanel(viewpanel.ViewPanel):
xdata
[
nans
]
=
np
.
nan
xdata
[
nans
]
=
np
.
nan
ydata
[
nans
]
=
np
.
nan
ydata
[
nans
]
=
np
.
nan
if
np
.
all
(
np
.
isnan
(
xdata
)
|
np
.
isnan
(
ydata
)):
return
(
0
,
0
),
(
0
,
0
)
kwargs
=
plotArgs
kwargs
=
plotArgs
kwargs
[
'
lw
'
]
=
kwargs
.
get
(
'
lw
'
,
ds
.
lineWidth
)
kwargs
[
'
lw
'
]
=
kwargs
.
get
(
'
lw
'
,
ds
.
lineWidth
)
kwargs
[
'
alpha
'
]
=
kwargs
.
get
(
'
alpha
'
,
ds
.
alpha
)
kwargs
[
'
alpha
'
]
=
kwargs
.
get
(
'
alpha
'
,
ds
.
alpha
)
...
...
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