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
ac93f9d0
Commit
ac93f9d0
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Removed allVolumes option - I will add it in (and make the
HistogramPanel nicer) at a later date.
parent
59ba241f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fsl/data/strings.py
+0
-1
0 additions, 1 deletion
fsl/data/strings.py
fsl/fslview/controls/histogramlistpanel.py
+4
-20
4 additions, 20 deletions
fsl/fslview/controls/histogramlistpanel.py
fsl/fslview/views/histogrampanel.py
+20
-30
20 additions, 30 deletions
fsl/fslview/views/histogrampanel.py
with
24 additions
and
51 deletions
fsl/data/strings.py
+
0
−
1
View file @
ac93f9d0
...
...
@@ -254,7 +254,6 @@ properties = TypeDict({
'
HistogramSeries.nbins
'
:
'
Number of bins
'
,
'
HistogramSeries.ignoreZeros
'
:
'
Ignore zeros
'
,
'
HistogramSeries.volume
'
:
'
Volume
'
,
'
HistogramSeries.allVolumes
'
:
'
Use all volumes
'
,
'
HistogramSeries.dataRange
'
:
'
Data range
'
,
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/controls/histogramlistpanel.py
+
4
−
20
View file @
ac93f9d0
...
...
@@ -127,23 +127,20 @@ class HistSeriesDialog(wx.Dialog):
self
.
__ignoreZeros
=
props
.
makeWidget
(
self
,
hs
,
'
ignoreZeros
'
)
self
.
__volume
=
props
.
makeWidget
(
self
,
hs
,
'
volume
'
,
showLimits
=
False
)
self
.
__allVolumes
=
props
.
makeWidget
(
self
,
hs
,
'
allVolumes
'
)
self
.
__dataRange
=
props
.
makeWidget
(
self
,
hs
,
'
dataRange
'
,
showLimits
=
False
)
self
.
__nbinsLbl
=
wx
.
StaticText
(
self
)
self
.
__ignoreZerosLbl
=
wx
.
StaticText
(
self
)
self
.
__volumeLbl
=
wx
.
StaticText
(
self
)
self
.
__allVolumesLbl
=
wx
.
StaticText
(
self
)
self
.
__dataRangeLbl
=
wx
.
StaticText
(
self
)
self
.
__nbinsLbl
.
SetLabel
(
strings
.
properties
[
hs
,
'
nbins
'
])
self
.
__ignoreZerosLbl
.
SetLabel
(
strings
.
properties
[
hs
,
'
ignoreZeros
'
])
self
.
__volumeLbl
.
SetLabel
(
strings
.
properties
[
hs
,
'
volume
'
])
self
.
__allVolumesLbl
.
SetLabel
(
strings
.
properties
[
hs
,
'
allVolumes
'
])
self
.
__dataRangeLbl
.
SetLabel
(
strings
.
properties
[
hs
,
'
dataRange
'
])
self
.
__sizer
=
wx
.
FlexGridSizer
(
5
,
2
)
self
.
__sizer
=
wx
.
FlexGridSizer
(
4
,
2
)
self
.
SetSizer
(
self
.
__sizer
)
...
...
@@ -153,15 +150,11 @@ class HistSeriesDialog(wx.Dialog):
self
.
__sizer
.
Add
(
self
.
__ignoreZeros
,
flag
=
wx
.
EXPAND
)
self
.
__sizer
.
Add
(
self
.
__volumeLbl
,
flag
=
wx
.
EXPAND
)
self
.
__sizer
.
Add
(
self
.
__volume
,
flag
=
wx
.
EXPAND
)
self
.
__sizer
.
Add
(
self
.
__allVolumesLbl
,
flag
=
wx
.
EXPAND
)
self
.
__sizer
.
Add
(
self
.
__allVolumes
,
flag
=
wx
.
EXPAND
)
self
.
__sizer
.
Add
(
self
.
__dataRangeLbl
,
flag
=
wx
.
EXPAND
)
self
.
__sizer
.
Add
(
self
.
__dataRange
,
flag
=
wx
.
EXPAND
)
self
.
__volume
.
Enable
(
hs
.
overlay
.
is4DImage
())
self
.
__volumeLbl
.
Enable
(
hs
.
overlay
.
is4DImage
())
self
.
__allVolumes
.
Enable
(
hs
.
overlay
.
is4DImage
())
self
.
__allVolumesLbl
.
Enable
(
hs
.
overlay
.
is4DImage
())
self
.
__volume
.
Enable
(
hs
.
overlay
.
is4DImage
())
self
.
__volumeLbl
.
Enable
(
hs
.
overlay
.
is4DImage
())
self
.
__autoBinChanged
()
hsPanel
.
addListener
(
'
autoBin
'
,
...
...
@@ -170,9 +163,6 @@ class HistSeriesDialog(wx.Dialog):
hsPanel
.
addListener
(
'
dataSeries
'
,
self
.
__name
,
self
.
__dataSeriesChanged
)
hs
.
addListener
(
'
allVolumes
'
,
self
.
__name
,
self
.
__allVolumesChanged
)
self
.
Bind
(
wx
.
EVT_WINDOW_DESTROY
,
self
.
__onDestroy
)
...
...
@@ -184,8 +174,7 @@ class HistSeriesDialog(wx.Dialog):
def
__onDestroy
(
self
,
ev
=
None
):
if
ev
is
not
None
:
ev
.
Skip
()
self
.
__hsPanel
.
removeListener
(
'
autoBin
'
,
self
.
__name
)
self
.
__hs
.
removeListener
(
'
allVolumes
'
,
self
.
__name
)
self
.
__hsPanel
.
removeListener
(
'
autoBin
'
,
self
.
__name
)
def
__dataSeriesChanged
(
self
,
*
a
):
...
...
@@ -193,11 +182,6 @@ class HistSeriesDialog(wx.Dialog):
self
.
Close
()
self
.
Destroy
()
self
.
__onDestroy
()
def
__allVolumesChanged
(
self
,
*
a
):
self
.
__volume
.
Enable
(
not
self
.
__hs
.
allVolumes
)
self
.
__volumeLbl
.
Enable
(
not
self
.
__hs
.
allVolumes
)
def
__autoBinChanged
(
self
,
*
a
):
...
...
This diff is collapsed.
Click to expand it.
fsl/fslview/views/histogrampanel.py
+
20
−
30
View file @
ac93f9d0
...
...
@@ -55,7 +55,6 @@ class HistogramSeries(plotpanel.DataSeries):
nbins
=
props
.
Int
(
minval
=
10
,
maxval
=
500
,
default
=
100
,
clamped
=
True
)
ignoreZeros
=
props
.
Boolean
(
default
=
True
)
volume
=
props
.
Int
(
minval
=
0
,
maxval
=
0
,
clamped
=
True
)
allVolumes
=
props
.
Boolean
(
default
=
False
)
dataRange
=
props
.
Bounds
(
ndims
=
1
,
labels
=
[
strings
.
choices
[
'
HistogramPanel.dataRange.min
'
],
...
...
@@ -78,7 +77,6 @@ class HistogramSeries(plotpanel.DataSeries):
self
.
addListener
(
'
nbins
'
,
self
.
name
,
self
.
histPropsChanged
)
self
.
addListener
(
'
ignoreZeros
'
,
self
.
name
,
self
.
histPropsChanged
)
self
.
addListener
(
'
volume
'
,
self
.
name
,
self
.
histPropsChanged
)
self
.
addListener
(
'
allVolumes
'
,
self
.
name
,
self
.
histPropsChanged
)
self
.
addListener
(
'
dataRange
'
,
self
.
name
,
self
.
histPropsChanged
)
...
...
@@ -88,27 +86,23 @@ class HistogramSeries(plotpanel.DataSeries):
def
__calcInitDataRange
(
self
):
if
self
.
overlay
.
is4DImage
():
if
self
.
allVolumes
:
data
=
self
.
overlay
.
data
[:]
else
:
data
=
self
.
overlay
.
data
[...,
self
.
volume
]
else
:
data
=
self
.
overlay
.
data
[:]
data
=
self
.
overlay
.
data
[:]
data
=
data
[
np
.
isfinite
(
data
)]
if
self
.
ignoreZeros
:
data
=
data
[
data
!=
0
]
dmin
=
data
.
min
()
dmax
=
data
.
max
()
self
.
dataRange
.
x
=
data
.
min
(),
data
.
max
()
self
.
dataRange
.
xmin
=
dmin
self
.
dataRange
.
xmax
=
dmax
self
.
dataRange
.
xlo
=
dmin
self
.
dataRange
.
xhi
=
dmax
def
histPropsChanged
(
self
,
*
a
):
if
self
.
overlay
.
is4DImage
():
if
self
.
allVolumes
:
data
=
self
.
overlay
.
data
[:]
else
:
data
=
self
.
overlay
.
data
[...,
self
.
volume
]
else
:
data
=
self
.
overlay
.
data
[:]
if
self
.
overlay
.
is4DImage
():
data
=
self
.
overlay
.
data
[...,
self
.
volume
]
else
:
data
=
self
.
overlay
.
data
[:]
data
=
data
[
np
.
isfinite
(
data
)]
...
...
@@ -218,11 +212,13 @@ class HistogramPanel(plotpanel.PlotPanel):
def
__overlaysChanged
(
self
,
*
a
):
self
.
disableListener
(
'
dataSeries
'
,
self
.
_name
)
for
ds
in
self
.
dataSeries
:
if
ds
.
overlay
not
in
self
.
_overlayList
:
self
.
dataSeries
.
remove
(
ds
)
self
.
enableListener
(
'
dataSeries
'
,
self
.
_name
)
self
.
draw
()
...
...
@@ -244,27 +240,21 @@ class HistogramPanel(plotpanel.PlotPanel):
def
__updateCurrent
(
self
,
*
a
):
overlay
=
self
.
_displayCtx
.
getSelectedOverlay
()
currentHs
=
self
.
__current
self
.
__current
=
None
if
len
(
self
.
_overlayList
)
==
0
or
\
not
isinstance
(
overlay
,
fslimage
.
Image
)
or
\
overlay
in
[
hs
.
overlay
for
hs
in
self
.
dataSeries
]:
return
if
currentHs
is
not
None
and
\
currentHs
.
overlay
not
in
[
hs
.
overlay
for
hs
in
self
.
dataSeries
]:
self
.
__current
=
currentHs
else
:
hs
=
HistogramSeries
(
self
,
overlay
)
hs
.
colour
=
[
0
,
0
,
0
]
hs
.
alpha
=
1
hs
.
lineWidth
=
2
hs
.
lineStyle
=
'
:
'
hs
.
label
=
None
self
.
__current
=
hs
hs
=
HistogramSeries
(
self
,
overlay
)
hs
.
colour
=
[
0
,
0
,
0
]
hs
.
alpha
=
1
hs
.
lineWidth
=
2
hs
.
lineStyle
=
'
:
'
hs
.
label
=
None
self
.
__current
=
hs
def
getCurrent
(
self
):
...
...
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