Skip to content

Commit

Permalink
Last version
Browse files Browse the repository at this point in the history
  • Loading branch information
c-h-benedetti committed Oct 23, 2024
1 parent b1a65dc commit 4d22cf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 110 deletions.
84 changes: 0 additions & 84 deletions exercise-03/_widget.py

This file was deleted.

29 changes: 3 additions & 26 deletions exercise-03/astrocytes.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import napari
import open3d as o3d
from scipy.spatial import KDTree, Delaunay
import csv
from multiprocessing import Pool
from functools import partial
import numpy as np
import os
import math
Expand Down Expand Up @@ -429,30 +425,11 @@ def run_workflow():
acs.decimate(0.8)

# Exporting mesh as PLY
for i, m in enumerate(acs.meshes):
o3d.io.write_triangle_mesh(f"/home/benedetti/Downloads/I2K/data/astrocytes/astrocytes-{i}.ply", m)

# Counting holes
# all_holes = acs.process_n_holes()
# for holes in all_holes:
# print("Number of holes: ", len(holes))
# print(np.unique([len(hole) for hole in holes]))
show_in_napari(acs)
# for i, m in enumerate(acs.meshes):
# o3d.io.write_triangle_mesh(f"/home/benedetti/Downloads/I2K/data/astrocytes/astrocytes-{i}.ply", m)

show_in_napari(acs)

def dump():
acs = AstrocytesContact()
target_folder = "/home/benedetti/Downloads/I2K/data/"
target_path = os.path.join(target_folder, "test-holes.ply")
acs.open_mesh(target_path)

all_holes = acs.process_n_holes()
for holes in all_holes:
print("Number of holes: ", len(holes))
print(np.unique([len(hole) for hole in holes]))
# for hole in holes:
# print("Hole size: ", len(hole))

if __name__ == "__main__":
run_workflow()
# show_in_napari(acs)

0 comments on commit 4d22cf4

Please sign in to comment.