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
78b22de4
Commit
78b22de4
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Adjust freesurer/gifti file extensions
parent
8d606bb2
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/data/freesurfer.py
+15
-10
15 additions, 10 deletions
fsl/data/freesurfer.py
fsl/data/gifti.py
+2
-5
2 additions, 5 deletions
fsl/data/gifti.py
with
17 additions
and
15 deletions
fsl/data/freesurfer.py
+
15
−
10
View file @
78b22de4
...
...
@@ -12,6 +12,7 @@ The following functions are also available:
.. autosummary::
:nosignatures:
loadFreesurferVertexFile
relatedFiles
"""
...
...
@@ -25,12 +26,12 @@ import fsl.utils.path as fslpath
import
fsl.data.mesh
as
fslmesh
ALLOWED
_EXTENSIONS
=
[
'
.pial
'
,
'
.white
'
,
'
.sphere
'
,
'
.inflated
'
,
'
.orig
'
,
'
.mid
'
]
GEOMETRY
_EXTENSIONS
=
[
'
.pial
'
,
'
.white
'
,
'
.sphere
'
,
'
.inflated
'
,
'
.orig
'
,
'
.mid
'
]
"""
File extensions which are interpreted as Freesurfer geometry files.
"""
...
...
@@ -41,7 +42,11 @@ EXTENSION_DESCRIPTIONS = [
"
Freesurfer surface
"
,
"
Freesurfer surface
"
,
"
Freesurfer surface
"
]
"""
A description for each extension in :attr:`ALLOWED_EXTENSIONS`.
"""
"""
A description for each extension in :attr:`GEOMETRY_EXTENSIONS`.
"""
VERTEX_DATA_EXTENSIONS
=
[
''
]
class
FreesurferMesh
(
fslmesh
.
Mesh
):
...
...
@@ -70,7 +75,7 @@ class FreesurferMesh(fslmesh.Mesh):
filename
=
op
.
abspath
(
filename
)
name
=
fslpath
.
removeExt
(
op
.
basename
(
filename
),
ALLOWED
_EXTENSIONS
)
GEOMETRY
_EXTENSIONS
)
fslmesh
.
Mesh
.
__init__
(
self
,
indices
,
...
...
@@ -85,7 +90,7 @@ class FreesurferMesh(fslmesh.Mesh):
if
loadAll
:
allFiles
=
relatedFiles
(
filename
,
ftypes
=
ALLOWED
_EXTENSIONS
)
allFiles
=
relatedFiles
(
filename
,
ftypes
=
GEOMETRY
_EXTENSIONS
)
for
f
in
allFiles
:
verts
,
idxs
=
nib
.
freesurfer
.
read_geometry
(
f
)
...
...
@@ -108,7 +113,7 @@ def relatedFiles(fname, ftypes=None):
"""
if
ftypes
is
None
:
ftypes
=
[
'
.annot
'
,
'
.label
'
,
'
.curv
'
,
'
.w
'
]
ftypes
=
VERTEX_DATA_EXTENSIONS
#
# .annot files contain labels for each vertex, and RGB values for each
...
...
This diff is collapsed.
Click to expand it.
fsl/data/gifti.py
+
2
−
5
View file @
78b22de4
...
...
@@ -35,16 +35,13 @@ import fsl.data.constants as constants
import
fsl.data.mesh
as
fslmesh
# We include .gii here because lots of things
# don't understand double-barrelled file
# extensions (e.g. the wxPython open file dialog).
ALLOWED_EXTENSIONS
=
[
'
.surf.gii
'
,
'
.gii
'
]
ALLOWED_EXTENSIONS
=
[
'
.surf.gii
'
]
"""
List of file extensions that a file containing Gifti surface data
is expected to have.
"""
EXTENSION_DESCRIPTIONS
=
[
'
GIFTI surface
file
'
,
'
GIFTI surface
file
'
]
EXTENSION_DESCRIPTIONS
=
[
'
GIFTI surface file
'
]
"""
A description for each of the :data:`ALLOWED_EXTENSIONS`.
"""
...
...
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