Skip to content

Commit

Permalink
Merge branch 'region_mesh_redux' of github.com:Hjorthmedh/Snudda into…
Browse files Browse the repository at this point in the history
… region_mesh_redux
  • Loading branch information
Hjorthmedh committed Oct 10, 2023
2 parents 63e054f + bca990b commit a3d8d01
Show file tree
Hide file tree
Showing 16 changed files with 75,605 additions and 1 deletion.
3,116 changes: 3,116 additions & 0 deletions snudda/data/mesh/GPe-left.obj

Large diffs are not rendered by default.

3,264 changes: 3,264 additions & 0 deletions snudda/data/mesh/GPe-right.obj

Large diffs are not rendered by default.

1,032 changes: 1,032 additions & 0 deletions snudda/data/mesh/GPi-left.obj

Large diffs are not rendered by default.

1,096 changes: 1,096 additions & 0 deletions snudda/data/mesh/GPi-right.obj

Large diffs are not rendered by default.

1,180 changes: 1,180 additions & 0 deletions snudda/data/mesh/SNc-left.obj

Large diffs are not rendered by default.

1,212 changes: 1,212 additions & 0 deletions snudda/data/mesh/SNc-right.obj

Large diffs are not rendered by default.

2,748 changes: 2,748 additions & 0 deletions snudda/data/mesh/SNr-left.obj

Large diffs are not rendered by default.

2,760 changes: 2,760 additions & 0 deletions snudda/data/mesh/SNr-right.obj

Large diffs are not rendered by default.

772 changes: 772 additions & 0 deletions snudda/data/mesh/STN-left.obj

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions snudda/data/mesh/STN-right.obj

Large diffs are not rendered by default.

16,380 changes: 16,380 additions & 0 deletions snudda/data/mesh/Striatum-d-left.obj

Large diffs are not rendered by default.

17,196 changes: 17,196 additions & 0 deletions snudda/data/mesh/Striatum-d-right.obj

Large diffs are not rendered by default.

11,848 changes: 11,848 additions & 0 deletions snudda/data/mesh/Striatum-v-left.obj

Large diffs are not rendered by default.

12,196 changes: 12,196 additions & 0 deletions snudda/data/mesh/Striatum-v-right.obj

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions snudda/data/mesh/cut_mesh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import open3d as o3d
import numpy as np


def cut_mesh(path, save=False):
mesh = o3d.io.read_triangle_mesh(path)
x, y, z = np.array(mesh.vertices).T
left = z > np.mean(z) # apparent mediolateral axis
left_idxs = np.where(left)[0]
left_mesh = mesh.select_by_index(left_idxs)
right_idxs = np.where(~left)[0]
right_mesh = mesh.select_by_index(right_idxs)

if save:
base = path.strip('.obj')
o3d.io.write_triangle_mesh(filename=base+'-left.obj', mesh=left_mesh)
o3d.io.write_triangle_mesh(filename=base+'-right.obj', mesh=right_mesh)

return mesh, right_mesh, left_mesh

if __name__ == '__main__':
meshes = ['Striatum-v.obj', 'Striatum-d.obj', 'GPe.obj', 'GPi.obj', 'STN.obj', 'SNr.obj', 'SNc.obj']
for mesh_name in meshes:
cut_mesh(mesh_name, save=True)
2 changes: 1 addition & 1 deletion snudda/place/region_mesh_redux.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def __init__(self):

if __name__ == "__main__":

mesh_path="/home/hjorth/HBP/Snudda/snudda/data/mesh/Striatum-dorsal-right-hemisphere.obj"
mesh_path="../data/mesh/Striatum-d-right.obj"

# nep = NeuronPlacer(mesh_path=mesh_path, d_min=10e-6, n_putative_points=10000000)
nep = NeuronPlacer(mesh_path=mesh_path, d_min=10e-6, n_putative_points=None, putative_density=100e3)
Expand Down

0 comments on commit a3d8d01

Please sign in to comment.