Skip to content
Snippets Groups Projects
Commit 3a52a698 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Vertex data size check in Gifti.loadVertexData

parent dbafefba
No related branches found
No related tags found
No related merge requests found
...@@ -82,8 +82,13 @@ class GiftiSurface(mesh.TriangleMesh): ...@@ -82,8 +82,13 @@ class GiftiSurface(mesh.TriangleMesh):
# TODO support 4D # TODO support 4D
# TODO make this more robust # TODO make this more robust
norms = nib.load(dataSource) vdata = nib.load(dataSource)
return norms.darrays[0].data vdata = vdata.darrays[0].data
if vdata.size != self.vertices.shape[0]:
raise ValueError('Incompatible size: {}'.format(dataSource))
return vdata
ALLOWED_EXTENSIONS = ['.surf.gii', '.gii'] ALLOWED_EXTENSIONS = ['.surf.gii', '.gii']
......
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