Commit 3a52a698 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Vertex data size check in Gifti.loadVertexData

parent dbafefba
Pipeline #271 failed with stage
......@@ -82,8 +82,13 @@ class GiftiSurface(mesh.TriangleMesh):
# TODO support 4D
# TODO make this more robust
norms = nib.load(dataSource)
return norms.darrays[0].data
vdata = nib.load(dataSource)
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']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment