diff --git a/fsl/data/freesurfer.py b/fsl/data/freesurfer.py index ed0c26f334ab3f2b10ba272c59c7aa961ca6d235..a8856334fbe086fbad4c4f16e44bc326a319becd 100644 --- a/fsl/data/freesurfer.py +++ b/fsl/data/freesurfer.py @@ -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 diff --git a/fsl/data/gifti.py b/fsl/data/gifti.py index 9bba0368b163f3f009669c3ffa5c3acbc9472f57..ab6e9c27abe7e75cd93448ef0f7e42af26c63a88 100644 --- a/fsl/data/gifti.py +++ b/fsl/data/gifti.py @@ -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`. """