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
5f26bb51
Commit
5f26bb51
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
MelodicImage updated to work with new Image interface (no longer a
HasProperties type).
parent
2be63aaf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/melodicimage.py
+28
-9
28 additions, 9 deletions
fsl/data/melodicimage.py
with
28 additions
and
9 deletions
fsl/data/melodicimage.py
+
28
−
9
View file @
5f26bb51
...
@@ -12,8 +12,6 @@ sub-class which encapsulates data from a MELODIC analysis.
...
@@ -12,8 +12,6 @@ sub-class which encapsulates data from a MELODIC analysis.
import
os.path
as
op
import
os.path
as
op
import
props
from
.
import
image
as
fslimage
from
.
import
image
as
fslimage
from
.
import
melodicanalysis
as
melanalysis
from
.
import
melodicanalysis
as
melanalysis
from
.
import
melodiclabels
as
mellabels
from
.
import
melodiclabels
as
mellabels
...
@@ -39,15 +37,14 @@ class MelodicImage(fslimage.Image):
...
@@ -39,15 +37,14 @@ class MelodicImage(fslimage.Image):
getTopLevelAnalysisDir
getTopLevelAnalysisDir
getDataFile
getDataFile
getICClassification
getICClassification
"""
tr
=
props
.
Real
(
default
=
1.0
)
The :attr:`tr` time of the ``MelodicImage`` may not be known when it is
"""
The TR time of the raw d
ata
from which
th
is
``MelodicImage`` w
as
created. If it is updated
at
a
later time,
th
e
``MelodicImage`` w
ill
generated. If it is possible to do so, this is automatically initialised
notify any listeners which are registerd on the ``
'
tr
'
`` topic (see the
from the data file (see the :meth:`getDataFile` method
).
:class:`.Notifier` interface
).
"""
"""
def
__init__
(
self
,
path
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
path
,
*
args
,
**
kwargs
):
"""
Create a ``MelodicImage``.
"""
Create a ``MelodicImage``.
...
@@ -69,6 +66,7 @@ class MelodicImage(fslimage.Image):
...
@@ -69,6 +66,7 @@ class MelodicImage(fslimage.Image):
fslimage
.
Image
.
__init__
(
self
,
path
,
*
args
,
**
kwargs
)
fslimage
.
Image
.
__init__
(
self
,
path
,
*
args
,
**
kwargs
)
meldir
=
op
.
dirname
(
path
)
meldir
=
op
.
dirname
(
path
)
self
.
__tr
=
1.0
self
.
__meldir
=
meldir
self
.
__meldir
=
meldir
self
.
__melmix
=
melanalysis
.
getComponentTimeSeries
(
meldir
)
self
.
__melmix
=
melanalysis
.
getComponentTimeSeries
(
meldir
)
self
.
__melFTmix
=
melanalysis
.
getComponentPowerSpectra
(
meldir
)
self
.
__melFTmix
=
melanalysis
.
getComponentPowerSpectra
(
meldir
)
...
@@ -83,12 +81,33 @@ class MelodicImage(fslimage.Image):
...
@@ -83,12 +81,33 @@ class MelodicImage(fslimage.Image):
loadData
=
False
,
loadData
=
False
,
calcRange
=
False
)
calcRange
=
False
)
if
dataImage
.
is4DImage
():
if
dataImage
.
is4DImage
():
self
.
tr
=
dataImage
.
pixdim
[
3
]
self
.
__
tr
=
dataImage
.
pixdim
[
3
]
# TODO load classifications if present
# TODO load classifications if present
for
i
in
range
(
self
.
numComponents
()):
for
i
in
range
(
self
.
numComponents
()):
self
.
__melICClass
.
addLabel
(
i
,
'
Unknown
'
)
self
.
__melICClass
.
addLabel
(
i
,
'
Unknown
'
)
@property
def
tr
(
self
):
"""
The TR time of the raw data from which this ``MelodicImage`` was
generated. If it is possible to do so, this is automatically
initialised from the data file (see the :meth:`getDataFile` method).
"""
return
self
.
__tr
@tr.setter
def
tr
(
self
,
val
):
"""
Set the :attr:`tr` time for this ``MelodicImage``. Any listeners
registered on the ``
'
tr
'
`` topic are notified of the update.
"""
oldval
=
self
.
__tr
self
.
__tr
=
val
if
oldval
!=
val
:
self
.
notify
(
'
tr
'
)
def
getComponentTimeSeries
(
self
,
component
):
def
getComponentTimeSeries
(
self
,
component
):
"""
Returns the time course for the specified (0-indexed) component.
"""
"""
Returns the time course for the specified (0-indexed) component.
"""
...
...
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