diff --git a/fsl/data/mesh.py b/fsl/data/mesh.py index 580f535c30e661253f132dfe093d4e9b79fa5b19..d74e89e31fe9b8190118d6df23780c3a60976fd2 100644 --- a/fsl/data/mesh.py +++ b/fsl/data/mesh.py @@ -214,7 +214,7 @@ class Mesh(notifier.Notifier, meta.Meta): # Add initial vertex # set if provided if vertices is not None: - self.addVertices(vertices) + self.addVertices(vertices, fixWinding=fixWinding) def __repr__(self): @@ -417,8 +417,9 @@ class Mesh(notifier.Notifier, meta.Meta): nvertices = self.vertices.shape[0] - if vdata.shape[0] != nvertices: - raise ValueError('Incompatible vertex data size: {}'.format(key)) + if vdata.ndim not in (1, 2) or vdata.shape[0] != nvertices: + raise ValueError('{}: incompatible vertex data ' + 'shape: {}'.format(key, vdata.shape)) self.__vertexData[key] = vdata.reshape(nvertices, -1) diff --git a/fsl/data/vtk.py b/fsl/data/vtk.py index 24835e7a3099ea54979d1f6c63cb7157b3e2bf51..f39a868ef16d68137cc829769856ecf2be27e954 100644 --- a/fsl/data/vtk.py +++ b/fsl/data/vtk.py @@ -71,8 +71,8 @@ class VTKMesh(fslmesh.Mesh): fslmesh.Mesh.__init__(self, indices, - name, - dataSource, + name=name, + dataSource=dataSource, vertices=data, fixWinding=fixWinding)