Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions neurd/soma_extraction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def side_length_check(current_mesh,side_length_ratio_threshold=3):

def largest_mesh_piece(msh):
mesh_splits_inner = msh.split(only_watertight=False)
mesh_splits_inner = np.array(mesh_splits_inner)
total_mesh_split_lengths_inner = [len(k.faces) for k in mesh_splits_inner]
ordered_mesh_splits_inner = mesh_splits_inner[np.flip(np.argsort(total_mesh_split_lengths_inner))]
return ordered_mesh_splits_inner[0]
Expand Down Expand Up @@ -995,6 +996,7 @@ def extract_soma_center(
#preforming the splits of the decimated mesh

mesh_splits = new_mesh.split(only_watertight=False)
mesh_splits = np.array(mesh_splits)

#get the largest mesh
mesh_lengths = np.array([len(split.faces) for split in mesh_splits])
Expand Down Expand Up @@ -1120,6 +1122,7 @@ def extract_soma_center(

#splitting the Poisson into the largest pieces and ordering them
mesh_splits_inner = new_mesh_inner.split(only_watertight=False)
mesh_splits_inner = np.array(mesh_splits_inner)
total_mesh_split_lengths_inner = [len(k.faces) for k in mesh_splits_inner]
ordered_mesh_splits_inner = mesh_splits_inner[np.flip(np.argsort(total_mesh_split_lengths_inner))]

Expand Down