Skip to content

Commit b2d8c7b

Browse files
committed
subset_neuron w/ meshes: fix issue with connectors (vertex -> vertex_id)
1 parent 3edb345 commit b2d8c7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

navis/morpho/subset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,15 @@ def _subset_meshneuron(x, subset, keep_disc_cn, prevent_fragments):
247247
# our `subset` is always a list of vertex indices)
248248
if not keep_disc_cn and x.has_connectors:
249249
if "vertex_id" not in x.connectors.columns:
250-
x.connectors["vertex"] = x.snap(x.connectors[["x", "y", "z"]].values)[0]
250+
x.connectors["vertex_id"] = x.snap(x.connectors[["x", "y", "z"]].values)[0]
251251

252-
x._connectors = x.connectors[x.connectors.vertex.isin(subset)].copy()
252+
x._connectors = x.connectors[x.connectors.vertex_id.isin(subset)].copy()
253253
x._connectors.reset_index(inplace=True, drop=True)
254254

255255
# Make old -> new indices map
256256
new_ix = dict(zip(subset, np.arange(0, len(subset))))
257257

258-
x.connectors["vertex"] = x.connectors.vertex.map(new_ix)
258+
x.connectors["vertex_id"] = x.connectors.vertex_id.map(new_ix)
259259

260260
if len(subset):
261261
x.vertices, x.faces = submesh(x, vertex_index=subset)

0 commit comments

Comments
 (0)