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
2d43d9e2
Commit
2d43d9e2
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TimeSeriesListPanel updated to work with refactored
TimeSeriesPanel. Some work to go.
parent
ee87fd94
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/controls/timeserieslistpanel.py
+48
-32
48 additions, 32 deletions
fsl/fsleyes/controls/timeserieslistpanel.py
fsl/fsleyes/plotting/__init__.py
+18
-0
18 additions, 0 deletions
fsl/fsleyes/plotting/__init__.py
with
66 additions
and
32 deletions
fsl/fsleyes/controls/timeserieslistpanel.py
+
48
−
32
View file @
2d43d9e2
...
...
@@ -10,17 +10,15 @@
"""
import
copy
import
wx
import
numpy
as
np
import
props
import
pwidgets.elistbox
as
elistbox
import
fsl.fsleyes.panel
as
fslpanel
import
fsl.fsleyes.tooltips
as
fsltooltips
import
fsl.
data.strings
as
str
ing
s
import
fsl.
fsleyes.colourmaps
as
fslcm
import
props
import
pwidgets.elistbox
as
elistbox
import
fsl.fsleyes.panel
as
fslpanel
import
fsl.fsleyes.tooltips
as
fsltooltips
import
fsl.
fsleyes.plotting
as
plott
ing
import
fsl.
data.strings
as
strings
class
TimeSeriesListPanel
(
fslpanel
.
FSLEyesPanel
):
...
...
@@ -152,37 +150,48 @@ class TimeSeriesListPanel(fslpanel.FSLEyesPanel):
:class:`.TimeSeriesPanel` (see the :class:`.TimeSeriesPanel` class
documentation).
"""
overlay
=
self
.
_displayCtx
.
getSelectedOverlay
()
import
fsl.fsleyes.views.timeseriespanel
as
tsp
if
overlay
is
None
:
return
ts
=
self
.
__tsPanel
.
get
Current
(
)
ts
=
self
.
__tsPanel
.
get
TimeSeries
(
overlay
)
if
ts
is
None
:
return
ts
=
copy
.
copy
(
ts
)
if
isinstance
(
ts
,
plotting
.
FEATTimeSeries
):
toAdd
=
list
(
ts
.
getModelTimeSeries
())
else
:
toAdd
=
[
ts
]
ts
.
alpha
=
1
ts
.
lineWidth
=
2
ts
.
lineStyle
=
'
-
'
ts
.
colour
=
fslcm
.
randomColour
()
ts
.
label
=
self
.
__makeLabel
(
ts
)
copies
=
[]
self
.
__tsPanel
.
dataSeries
.
append
(
ts
)
for
ts
in
toAdd
:
if
isinstance
(
ts
,
tsp
.
FEATTimeSeries
):
modelTs
=
ts
.
getModelTimeSeries
()
modelTs
.
remove
(
ts
)
copy
=
plotting
.
DataSeries
(
ts
.
overlay
)
for
mts
in
modelTs
:
copy
.
alpha
=
ts
.
alpha
copy
.
lineWidth
=
ts
.
lineWidth
copy
.
lineStyle
=
ts
.
lineStyle
copy
.
colour
=
ts
.
colour
copy
.
label
=
ts
.
label
mts
.
alpha
=
1
mts
.
lineWidth
=
2
mts
.
lineStyle
=
'
-
'
mts
.
label
=
mts
.
makeLabel
()
copy
.
setData
(
*
ts
.
getData
())
self
.
__tsPanel
.
dataSeries
.
extend
(
modelTs
)
# This is hacky, and is here in order to
# make the __onLIstSelect method work.
if
isinstance
(
ts
,
plotting
.
MelodicTimeSeries
):
copy
.
tsLoc
=
'
volume
'
copy
.
coord
=
ts
.
getComponent
()
else
:
copy
.
tsLoc
=
'
location
'
copy
.
coord
=
ts
.
getVoxel
()
copies
.
append
(
copy
)
self
.
__tsPanel
.
dataSeries
.
extend
(
copies
)
def
__onListEdit
(
self
,
ev
):
...
...
@@ -201,14 +210,21 @@ class TimeSeriesListPanel(fslpanel.FSLEyesPanel):
the corresponding :class:`.TimeSeries` instance.
"""
overlay
=
ev
.
data
.
overlay
coords
=
ev
.
data
.
coords
ts
=
ev
.
data
overlay
=
ts
.
overlay
opts
=
self
.
_displayCtx
.
getOpts
(
overlay
)
vox
=
np
.
array
(
coords
)
disp
=
opts
.
transformCoords
([
vox
],
'
voxel
'
,
'
display
'
)[
0
]
# See hacky things in __onListAdd
if
ts
.
tsLoc
==
'
volume
'
:
opts
.
volume
=
ts
.
coord
elif
ts
.
tsLoc
==
'
location
'
:
voxLoc
=
np
.
array
(
ts
.
coord
)
disLoc
=
opts
.
transformCoords
([
voxLoc
],
'
voxel
'
,
'
display
'
)[
0
]
self
.
_displayCtx
.
location
=
disLoc
self
.
_displayCtx
.
selectedOverlay
=
self
.
_overlayList
.
index
(
overlay
)
self
.
_displayCtx
.
location
=
disp
def
__onListRemove
(
self
,
ev
):
...
...
This diff is collapsed.
Click to expand it.
fsl/fsleyes/plotting/__init__.py
+
18
−
0
View file @
2d43d9e2
#!/usr/bin/env python
#
# __init__.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import
dataseries
import
timeseries
DataSeries
=
dataseries
.
DataSeries
TimeSeries
=
timeseries
.
TimeSeries
FEATTimeSeries
=
timeseries
.
FEATTimeSeries
FEATPartialFitTimeSeries
=
timeseries
.
FEATPartialFitTimeSeries
FEATEVTimeSeries
=
timeseries
.
FEATEVTimeSeries
FEATResidualTimeSeries
=
timeseries
.
FEATResidualTimeSeries
FEATModelFitTimeSeries
=
timeseries
.
FEATModelFitTimeSeries
MelodicTimeSeries
=
timeseries
.
MelodicTimeSeries
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