Skip to content
Snippets Groups Projects
Commit 78b22de4 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Adjust freesurer/gifti file extensions

parent 8d606bb2
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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`. """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment