amaazetools 0.1.8__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {amaazetools-0.1.8/amaazetools.egg-info → amaazetools-0.2.0}/PKG-INFO +3 -2
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools/dicom.py +4 -3
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools/trimesh.py +16 -4
- {amaazetools-0.1.8 → amaazetools-0.2.0/amaazetools.egg-info}/PKG-INFO +3 -2
- {amaazetools-0.1.8 → amaazetools-0.2.0}/pyproject.toml +1 -1
- {amaazetools-0.1.8 → amaazetools-0.2.0}/LICENSE +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/MANIFEST.in +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/README.md +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools/__init__.py +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools/edge_detection.py +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools/mesh_segmentation.py +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools/svi.py +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools.egg-info/SOURCES.txt +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools.egg-info/dependency_links.txt +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools.egg-info/requires.txt +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/amaazetools.egg-info/top_level.txt +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/setup.cfg +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/setup.py +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/cextensions.c +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/memory_allocation.c +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/memory_allocation.h +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/mesh_operations.c +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/mesh_operations.h +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/svi_computations.c +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/svi_computations.h +0 -0
- {amaazetools-0.1.8 → amaazetools-0.2.0}/src/vector_operations.h +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: amaazetools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Python package for mesh processing tools developed by AMAAZE
|
|
5
5
|
Author-email: Jeff Calder <jwcalder@umn.edu>
|
|
6
6
|
License: MIT
|
|
@@ -21,6 +21,7 @@ Requires-Dist: scikit-learn
|
|
|
21
21
|
Requires-Dist: matplotlib
|
|
22
22
|
Requires-Dist: graphlearning
|
|
23
23
|
Requires-Dist: plyfile
|
|
24
|
+
Dynamic: license-file
|
|
24
25
|
|
|
25
26
|
# AMAAZE Tools
|
|
26
27
|
|
|
@@ -486,9 +486,10 @@ def process_dicom(directory, scanlayout, CTdir='ScanOverviews', Meshdir='Meshes'
|
|
|
486
486
|
str_z1 = np.array2string(z1, separator=',')
|
|
487
487
|
str_z2 = np.array2string(z2, separator=',')
|
|
488
488
|
|
|
489
|
-
df = df.
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
df = pd.concat([df, pd.DataFrame([{'ScanPacket':subdir, 'Process':True, 'x1':str_x1, 'x2':str_x2, 'y1':str_y1, 'y2':str_y2, 'z1':str_z1, 'z2':str_z2}])], ignore_index=True)
|
|
490
|
+
#df = df.append({'ScanPacket':subdir, 'Process':True, 'x1':str_x1, 'x2':str_x2,
|
|
491
|
+
# 'y1':str_y1, 'y2':str_y2,
|
|
492
|
+
# 'z1':str_z1, 'z2':str_z2,}, ignore_index=True)
|
|
492
493
|
else: #Load chop locations from spreadsheet
|
|
493
494
|
|
|
494
495
|
x1 = np.fromstring(chopsheet['x1'][i][1:-1], sep=',').astype(int)
|
|
@@ -43,14 +43,22 @@ def marching_cubes(volume,level=None,spacing=(1,1,1)):
|
|
|
43
43
|
points of triangulation
|
|
44
44
|
t : (m,3) int
|
|
45
45
|
triangles of triangulation
|
|
46
|
+
n : (n,3) float
|
|
47
|
+
vertex normals of triangulated surface
|
|
48
|
+
val : (n) float
|
|
49
|
+
isosurface values
|
|
46
50
|
"""
|
|
47
51
|
|
|
48
|
-
p,t,n,val = measure.marching_cubes(volume,level=level,spacing=spacing)
|
|
52
|
+
p,t,n,val = measure.marching_cubes(volume,level=level,spacing=spacing,allow_degenerate=False)
|
|
49
53
|
|
|
50
54
|
#sometimes marching cubes produces... artifacts... so here's a very basic intro to mesh cleaning!
|
|
51
55
|
#first: eliminate repeated points:
|
|
56
|
+
'''
|
|
52
57
|
p,index,inv = np.unique(p,axis=0, return_index=True,return_inverse=True)
|
|
53
58
|
|
|
59
|
+
n = n[index,:]
|
|
60
|
+
val = val[index]
|
|
61
|
+
|
|
54
62
|
#next: rid triangulation of non-triangles:
|
|
55
63
|
t = inv[t]
|
|
56
64
|
badt = (t[:,0]==t[:,1])+(t[:,1]==t[:,2])+(t[:,2]==t[:,0])
|
|
@@ -60,9 +68,13 @@ def marching_cubes(volume,level=None,spacing=(1,1,1)):
|
|
|
60
68
|
ind = -1*np.ones(p.shape[0],int)
|
|
61
69
|
uni = np.unique(t.flatten()) #these are already sorted for numpy
|
|
62
70
|
ind[uni] = np.arange(uni.shape[0])
|
|
63
|
-
p = p[ind>-1,:]
|
|
64
|
-
t = ind[t]
|
|
65
71
|
|
|
72
|
+
L = ind>-1
|
|
73
|
+
p = p[L,:]
|
|
74
|
+
n = n[L,:]
|
|
75
|
+
val = val[L]
|
|
76
|
+
t = ind[t]
|
|
77
|
+
'''
|
|
66
78
|
#finally, check right hand rule... this works for ~convex objects, anyway...
|
|
67
79
|
#m = tm.mesh(p,t)
|
|
68
80
|
|
|
@@ -72,7 +84,7 @@ def marching_cubes(volume,level=None,spacing=(1,1,1)):
|
|
|
72
84
|
#cent = m.points.mean(0)
|
|
73
85
|
#fliporder = np.sum(tn*(tc-cent),1)<0
|
|
74
86
|
#t[fliporder,1:3] = t[fliporder,2:0:-1]
|
|
75
|
-
return p,t
|
|
87
|
+
return p,t,n,val
|
|
76
88
|
|
|
77
89
|
def withiness(x):
|
|
78
90
|
""" Computes withiness (how well 1-D data clusters into two groups).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: amaazetools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Python package for mesh processing tools developed by AMAAZE
|
|
5
5
|
Author-email: Jeff Calder <jwcalder@umn.edu>
|
|
6
6
|
License: MIT
|
|
@@ -21,6 +21,7 @@ Requires-Dist: scikit-learn
|
|
|
21
21
|
Requires-Dist: matplotlib
|
|
22
22
|
Requires-Dist: graphlearning
|
|
23
23
|
Requires-Dist: plyfile
|
|
24
|
+
Dynamic: license-file
|
|
24
25
|
|
|
25
26
|
# AMAAZE Tools
|
|
26
27
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|