for hemi_to in range(2): // iterate over to / block-rows of CSR matrix
hemi_from = (1 - hemi_to) if xhemi else hemi_to
idx_use = vertices_from[hemi_from]
iflen(idx_use)== 0:
morpher.append(
sparse.csr_matrix((len(vertices_to[hemi_to]), 0)))
continue e = mesh_edges(tris[hemi_from])
e.data[e.data == 2] = 1
n_vertices = e.shape[0]
e = e + sparse.eye(n_vertices, n_vertices)
m = sparse.eye(len(idx_use), len(idx_use), format="csr")
mm = _morph_buffer(m, idx_use, e, smooth, n_vertices,
vertices_to[hemi_to], maps[hemi_from], warn=warn)
assert mm.shape == (len(vertices_to[hemi_to]),
len(vertices_from[hemi_from]))
After Change
for hemi_to in range(2): // iterate over to / block-rows of CSR matrix
hemi_from = (1 - hemi_to) if xhemi else hemi_to
morpher.append(_hemi_morph(
tris[hemi_from], vertices_to[hemi_to], vertices_from[hemi_from],
smooth, maps[hemi_from], warn))
shape = (sum(len(v) for v in vertices_to),