amaazetools 0.0.9__tar.gz → 0.1.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.0.9/amaazetools.egg-info → amaazetools-0.1.0}/PKG-INFO +2 -2
- {amaazetools-0.0.9 → amaazetools-0.1.0}/README.md +1 -1
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools/trimesh.py +98 -47
- {amaazetools-0.0.9 → amaazetools-0.1.0/amaazetools.egg-info}/PKG-INFO +2 -2
- {amaazetools-0.0.9 → amaazetools-0.1.0}/pyproject.toml +1 -1
- {amaazetools-0.0.9 → amaazetools-0.1.0}/LICENSE +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/MANIFEST.in +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools/__init__.py +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools/dicom.py +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools/edge_detection.py +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools/mesh_segmentation.py +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools/svi.py +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools.egg-info/SOURCES.txt +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools.egg-info/dependency_links.txt +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools.egg-info/requires.txt +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/amaazetools.egg-info/top_level.txt +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/setup.cfg +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/setup.py +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/cextensions.c +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/memory_allocation.c +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/memory_allocation.h +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/mesh_operations.c +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/mesh_operations.h +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/svi_computations.c +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/svi_computations.h +0 -0
- {amaazetools-0.0.9 → amaazetools-0.1.0}/src/vector_operations.h +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: amaazetools
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.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
|
|
@@ -37,7 +37,7 @@ To install the most recent developers version of the package, run
|
|
|
37
37
|
git clone https://github.com/jwcalder/AMAAZETools
|
|
38
38
|
cd AMAAZETools
|
|
39
39
|
pip install -r requirements.txt
|
|
40
|
-
|
|
40
|
+
pip install .
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Documentation
|
|
@@ -349,52 +349,6 @@ class mesh:
|
|
|
349
349
|
sys.exit("'point' must be an integer index, or a length 3 list, tuple, or numpy ndarray (x,y,z)")
|
|
350
350
|
return point_ind
|
|
351
351
|
|
|
352
|
-
def edge_points(self,u,k=7,return_mask=False,number=None):
|
|
353
|
-
""" Computes the edge points of the mesh.
|
|
354
|
-
|
|
355
|
-
Parameters
|
|
356
|
-
----------
|
|
357
|
-
u : (num_verts,1) int array
|
|
358
|
-
Array of labels for each point.
|
|
359
|
-
k : int, default is 7
|
|
360
|
-
Number of nearest neighbors to use.
|
|
361
|
-
return_mask : boolean, default is False
|
|
362
|
-
If True, return edge_points as a (num,verts,) boolean array.
|
|
363
|
-
number : int, default is None
|
|
364
|
-
Max number of edge points to return.
|
|
365
|
-
|
|
366
|
-
Returns
|
|
367
|
-
-------
|
|
368
|
-
An int array containing the edge point indices.
|
|
369
|
-
"""
|
|
370
|
-
|
|
371
|
-
W = gl.weightmatrix.knn(self.points,k,kernel='uniform',symmetrize=False)
|
|
372
|
-
d = gl.graph(W).degree_vector()
|
|
373
|
-
mask = d*u != W@u
|
|
374
|
-
|
|
375
|
-
#Select a few points spaced out along edge
|
|
376
|
-
if number is not None:
|
|
377
|
-
edge_ind = np.arange(self.num_verts())[mask]
|
|
378
|
-
edge_points = self.points[mask,:]
|
|
379
|
-
num_edge_points = len(edge_points)
|
|
380
|
-
|
|
381
|
-
#PCA
|
|
382
|
-
mean = np.mean(edge_points,axis=0)
|
|
383
|
-
cov = (edge_points-mean).T@(edge_points-mean)
|
|
384
|
-
l,v = sparse.linalg.eigs(cov,k=1,which='LM')
|
|
385
|
-
proj = (edge_points-mean)@v.real
|
|
386
|
-
|
|
387
|
-
#Sort along princpal axis
|
|
388
|
-
sort_ind = np.argsort(proj.flatten())
|
|
389
|
-
dx = (num_edge_points-1)/(number-1)
|
|
390
|
-
spaced_edge_ind = edge_ind[sort_ind[np.arange(0,num_edge_points,dx).astype(int)]]
|
|
391
|
-
mask = np.zeros(self.num_verts(),dtype=bool)
|
|
392
|
-
mask[spaced_edge_ind]=True
|
|
393
|
-
|
|
394
|
-
if return_mask:
|
|
395
|
-
return mask.astype(int)
|
|
396
|
-
else: #return indices
|
|
397
|
-
return np.arange(self.num_verts())[mask]
|
|
398
352
|
|
|
399
353
|
def geodesic_patch(self,point,r,k=7,return_mask=False):
|
|
400
354
|
""" Computes a geodesic patch around a specified point.
|
|
@@ -1052,7 +1006,7 @@ class mesh:
|
|
|
1052
1006
|
euclidean_radius = np.max(np.linalg.norm(patch - center,axis=1))
|
|
1053
1007
|
|
|
1054
1008
|
if return_edge_points:
|
|
1055
|
-
E =
|
|
1009
|
+
E = edge_points(patch,C_local,k=k,number=number_edge_points)
|
|
1056
1010
|
E = patch_ind[E]
|
|
1057
1011
|
if return_euclidean_radius:
|
|
1058
1012
|
return theta,n1,n2,C,E,euclidean_radius
|
|
@@ -1268,3 +1222,100 @@ def canonical_labels(u):
|
|
|
1268
1222
|
u[J] = label
|
|
1269
1223
|
return u
|
|
1270
1224
|
|
|
1225
|
+
def edge_points(points,u,k=7,return_mask=False,number=None):
|
|
1226
|
+
""" Computes the edge points of the mesh.
|
|
1227
|
+
|
|
1228
|
+
Parameters
|
|
1229
|
+
----------
|
|
1230
|
+
points : (n,3) float array
|
|
1231
|
+
Coordinates of points.
|
|
1232
|
+
u : (num_verts,1) int array
|
|
1233
|
+
Array of labels for each point.
|
|
1234
|
+
k : int, default is 7
|
|
1235
|
+
Number of nearest neighbors to use.
|
|
1236
|
+
return_mask : boolean, default is False
|
|
1237
|
+
If True, return edge_points as a (num_verts,) boolean array.
|
|
1238
|
+
number : int, default is None
|
|
1239
|
+
Max number of edge points to return.
|
|
1240
|
+
|
|
1241
|
+
Returns
|
|
1242
|
+
-------
|
|
1243
|
+
An int array containing the edge point indices.
|
|
1244
|
+
"""
|
|
1245
|
+
|
|
1246
|
+
num_verts = points.shape[0]
|
|
1247
|
+
W = gl.weightmatrix.knn(points,k,kernel='uniform',symmetrize=False)
|
|
1248
|
+
d = gl.graph(W).degree_vector()
|
|
1249
|
+
mask = d*u != W@u
|
|
1250
|
+
|
|
1251
|
+
#Select a few points spaced out along edge
|
|
1252
|
+
if number is not None:
|
|
1253
|
+
edge_ind = np.arange(num_verts)[mask]
|
|
1254
|
+
edge_points = points[mask,:]
|
|
1255
|
+
num_edge_points = len(edge_points)
|
|
1256
|
+
|
|
1257
|
+
#PCA
|
|
1258
|
+
mean = np.mean(edge_points,axis=0)
|
|
1259
|
+
cov = (edge_points-mean).T@(edge_points-mean)
|
|
1260
|
+
l,v = sparse.linalg.eigs(cov,k=1,which='LM')
|
|
1261
|
+
proj = (edge_points-mean)@v.real
|
|
1262
|
+
|
|
1263
|
+
#Sort along princpal axis
|
|
1264
|
+
sort_ind = np.argsort(proj.flatten())
|
|
1265
|
+
dx = (num_edge_points-1)/(number-1)
|
|
1266
|
+
spaced_edge_ind = edge_ind[sort_ind[np.arange(0,num_edge_points,dx).astype(int)]]
|
|
1267
|
+
mask = np.zeros(num_verts,dtype=bool)
|
|
1268
|
+
mask[spaced_edge_ind]=True
|
|
1269
|
+
|
|
1270
|
+
if return_mask:
|
|
1271
|
+
return mask.astype(int)
|
|
1272
|
+
else: #return indices
|
|
1273
|
+
return np.arange(num_verts)[mask]
|
|
1274
|
+
|
|
1275
|
+
#def edge_points(self,u,k=7,return_mask=False,number=None):
|
|
1276
|
+
# """ Computes the edge points of the mesh.
|
|
1277
|
+
#
|
|
1278
|
+
# Parameters
|
|
1279
|
+
# ----------
|
|
1280
|
+
# u : (num_verts,1) int array
|
|
1281
|
+
# Array of labels for each point.
|
|
1282
|
+
# k : int, default is 7
|
|
1283
|
+
# Number of nearest neighbors to use.
|
|
1284
|
+
# return_mask : boolean, default is False
|
|
1285
|
+
# If True, return edge_points as a (num,verts,) boolean array.
|
|
1286
|
+
# number : int, default is None
|
|
1287
|
+
# Max number of edge points to return.
|
|
1288
|
+
#
|
|
1289
|
+
# Returns
|
|
1290
|
+
# -------
|
|
1291
|
+
# An int array containing the edge point indices.
|
|
1292
|
+
# """
|
|
1293
|
+
#
|
|
1294
|
+
# W = gl.weightmatrix.knn(self.points,k,kernel='uniform',symmetrize=False)
|
|
1295
|
+
# d = gl.graph(W).degree_vector()
|
|
1296
|
+
# mask = d*u != W@u
|
|
1297
|
+
#
|
|
1298
|
+
# #Select a few points spaced out along edge
|
|
1299
|
+
# if number is not None:
|
|
1300
|
+
# edge_ind = np.arange(self.num_verts())[mask]
|
|
1301
|
+
# edge_points = self.points[mask,:]
|
|
1302
|
+
# num_edge_points = len(edge_points)
|
|
1303
|
+
#
|
|
1304
|
+
# #PCA
|
|
1305
|
+
# mean = np.mean(edge_points,axis=0)
|
|
1306
|
+
# cov = (edge_points-mean).T@(edge_points-mean)
|
|
1307
|
+
# l,v = sparse.linalg.eigs(cov,k=1,which='LM')
|
|
1308
|
+
# proj = (edge_points-mean)@v.real
|
|
1309
|
+
#
|
|
1310
|
+
# #Sort along princpal axis
|
|
1311
|
+
# sort_ind = np.argsort(proj.flatten())
|
|
1312
|
+
# dx = (num_edge_points-1)/(number-1)
|
|
1313
|
+
# spaced_edge_ind = edge_ind[sort_ind[np.arange(0,num_edge_points,dx).astype(int)]]
|
|
1314
|
+
# mask = np.zeros(self.num_verts(),dtype=bool)
|
|
1315
|
+
# mask[spaced_edge_ind]=True
|
|
1316
|
+
#
|
|
1317
|
+
# if return_mask:
|
|
1318
|
+
# return mask.astype(int)
|
|
1319
|
+
# else: #return indices
|
|
1320
|
+
# return np.arange(self.num_verts())[mask]
|
|
1321
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: amaazetools
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.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
|
|
@@ -37,7 +37,7 @@ To install the most recent developers version of the package, run
|
|
|
37
37
|
git clone https://github.com/jwcalder/AMAAZETools
|
|
38
38
|
cd AMAAZETools
|
|
39
39
|
pip install -r requirements.txt
|
|
40
|
-
|
|
40
|
+
pip install .
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Documentation
|
|
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
|