From 581400f2cf5c552e2b70ccfa839d43675e49afa6 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Mon, 16 Mar 2020 18:20:14 +0000
Subject: [PATCH] RF: Allow .gii surfaces, but don't try to auto-load them

---
 fsl/data/gifti.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fsl/data/gifti.py b/fsl/data/gifti.py
index 2d1f3856d..4f8cc2f91 100644
--- a/fsl/data/gifti.py
+++ b/fsl/data/gifti.py
@@ -102,8 +102,11 @@ class GiftiMesh(fslmesh.Mesh):
         # as the specfiied one.
         if loadAll:
 
+            # Only attempt to auto-load sensibly
+            # named gifti files (i.e. *.surf.gii,
+            # rather than *.gii).
+            surfFiles = relatedFiles(infile, [ALLOWED_EXTENSIONS[0]])
             nvertices = vertices[0].shape[0]
-            surfFiles = relatedFiles(infile, ALLOWED_EXTENSIONS)
 
             for sfile in surfFiles:
 
-- 
GitLab