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
15ecde79
Commit
15ecde79
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TriangleMesh/GiftiSurface classes have method to load vertex data. I/O will be
kept in these classes, instead of in FSLeyes.
parent
b6e191b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/data/gifti.py
+12
-1
12 additions, 1 deletion
fsl/data/gifti.py
fsl/data/mesh.py
+17
-0
17 additions, 0 deletions
fsl/data/mesh.py
with
29 additions
and
1 deletion
fsl/data/gifti.py
+
12
−
1
View file @
15ecde79
...
...
@@ -23,6 +23,8 @@ are available:
import
os.path
as
op
import
nibabel
as
nib
import
fsl.utils.path
as
fslpath
from
.
import
mesh
...
...
@@ -50,7 +52,6 @@ class GiftiSurface(mesh.TriangleMesh):
:arg infile: A GIFTI surface file
"""
import
nibabel
as
nib
surfimg
=
nib
.
load
(
infile
)
vertices
,
indices
=
extractGiftiSurface
(
surfimg
)
...
...
@@ -65,6 +66,16 @@ class GiftiSurface(mesh.TriangleMesh):
self
.
surfImg
=
surfimg
def
loadVertexData
(
self
,
dataSource
):
"""
Attempts to load scalar data associated with each vertex of this
``GiftiSurface`` from the given ``dataSource``.
"""
# TODO make this more robust
norms
=
nib
.
load
(
dataSource
)
return
norms
.
darrays
[
0
].
data
ALLOWED_EXTENSIONS
=
[
'
.surf.gii
'
,
'
.gii
'
]
"""
List of file extensions that a file containing Gifti surface data
is expected to have.
...
...
This diff is collapsed.
Click to expand it.
fsl/data/mesh.py
+
17
−
0
View file @
15ecde79
...
...
@@ -55,6 +55,14 @@ class TriangleMesh(object):
the vertex indices for :math:`M` triangles
============== ====================================================
And the following methods:
.. autosummary::
:nosignatures:
getBounds
loadVertexData
"""
...
...
@@ -117,6 +125,15 @@ class TriangleMesh(object):
return
(
self
.
__loBounds
,
self
.
__hiBounds
)
def
loadVertexData
(
self
,
dataSource
):
"""
Attempts to load scalar data associated with each vertex of this
``TriangleMesh`` from the given ``dataSource``.
This method may be overridden by sub-classes.
"""
raise
NotImplementedError
(
'
Not implemented yet
'
)
ALLOWED_EXTENSIONS
=
[
'
.vtk
'
]
"""
A list of file extensions which could contain :class:`TriangleMesh` data.
"""
...
...
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