amaazetools 0.0.8__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.
Files changed (27) hide show
  1. {amaazetools-0.0.8/amaazetools.egg-info → amaazetools-0.1.0}/PKG-INFO +15 -9
  2. {amaazetools-0.0.8 → amaazetools-0.1.0}/README.md +1 -1
  3. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools/trimesh.py +100 -49
  4. {amaazetools-0.0.8 → amaazetools-0.1.0/amaazetools.egg-info}/PKG-INFO +15 -9
  5. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools.egg-info/SOURCES.txt +1 -0
  6. amaazetools-0.1.0/pyproject.toml +38 -0
  7. amaazetools-0.1.0/setup.py +16 -0
  8. amaazetools-0.0.8/setup.py +0 -41
  9. {amaazetools-0.0.8 → amaazetools-0.1.0}/LICENSE +0 -0
  10. {amaazetools-0.0.8 → amaazetools-0.1.0}/MANIFEST.in +0 -0
  11. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools/__init__.py +0 -0
  12. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools/dicom.py +0 -0
  13. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools/edge_detection.py +0 -0
  14. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools/mesh_segmentation.py +0 -0
  15. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools/svi.py +0 -0
  16. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools.egg-info/dependency_links.txt +0 -0
  17. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools.egg-info/requires.txt +0 -0
  18. {amaazetools-0.0.8 → amaazetools-0.1.0}/amaazetools.egg-info/top_level.txt +0 -0
  19. {amaazetools-0.0.8 → amaazetools-0.1.0}/setup.cfg +0 -0
  20. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/cextensions.c +0 -0
  21. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/memory_allocation.c +0 -0
  22. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/memory_allocation.h +0 -0
  23. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/mesh_operations.c +0 -0
  24. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/mesh_operations.h +0 -0
  25. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/svi_computations.c +0 -0
  26. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/svi_computations.h +0 -0
  27. {amaazetools-0.0.8 → amaazetools-0.1.0}/src/vector_operations.h +0 -0
@@ -1,18 +1,26 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: amaazetools
3
- Version: 0.0.8
3
+ Version: 0.1.0
4
4
  Summary: Python package for mesh processing tools developed by AMAAZE
5
- Home-page: https://github.com/jwcalder/AMAAZETools
6
- Author: Jeff Calder
7
- Author-email: jwcalder@umn.edu
8
- License: UNKNOWN
9
- Platform: UNKNOWN
5
+ Author-email: Jeff Calder <jwcalder@umn.edu>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jwcalder/AMAAZETools
8
+ Project-URL: Bug Tracker, https://github.com/jwcalder/AMAAZETools/issues
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Operating System :: OS Independent
13
12
  Requires-Python: >=3.6
14
13
  Description-Content-Type: text/markdown
15
14
  License-File: LICENSE
15
+ Requires-Dist: numpy
16
+ Requires-Dist: scipy
17
+ Requires-Dist: pandas
18
+ Requires-Dist: pydicom
19
+ Requires-Dist: scikit-image
20
+ Requires-Dist: sklearn
21
+ Requires-Dist: matplotlib
22
+ Requires-Dist: graphlearning
23
+ Requires-Dist: plyfile
16
24
 
17
25
  # AMAAZE Tools
18
26
 
@@ -29,7 +37,7 @@ To install the most recent developers version of the package, run
29
37
  git clone https://github.com/jwcalder/AMAAZETools
30
38
  cd AMAAZETools
31
39
  pip install -r requirements.txt
32
- python setup.py install --user
40
+ pip install .
33
41
  ```
34
42
 
35
43
  ## Documentation
@@ -47,5 +55,3 @@ Several people have contributed to the development of this software:
47
55
  1. David Floeder
48
56
  2. Riley O'Neill
49
57
  3. Brendan Cook
50
-
51
-
@@ -13,7 +13,7 @@ To install the most recent developers version of the package, run
13
13
  git clone https://github.com/jwcalder/AMAAZETools
14
14
  cd AMAAZETools
15
15
  pip install -r requirements.txt
16
- python setup.py install --user
16
+ pip install .
17
17
  ```
18
18
 
19
19
  ## Documentation
@@ -271,7 +271,7 @@ def synth_mesh(angle, num_pts):
271
271
  f = np.minimum(f,0.4 + z)
272
272
 
273
273
  #Marching cubes for isosurface
274
- verts,faces,normals,values = measure.marching_cubes(f,0,spacing=(h,h,h))
274
+ verts,faces,normals,values = measure.marching_cubes(f,0,spacing=(h,h,h),allow_degenerate=False)
275
275
 
276
276
  #Adjust angle
277
277
  verts -= [1,1,1]
@@ -339,7 +339,7 @@ class mesh:
339
339
  The index of the given point as an integer.
340
340
  """
341
341
 
342
- if type(point) in [np.int,np.int32,np.int64]:
342
+ if type(point) in [int,np.int32,np.int64]:
343
343
  point_ind=point
344
344
  elif type(point) == np.ndarray and len(point)==3:
345
345
  point_ind = np.argmin(np.linalg.norm(self.points - point,axis=1))
@@ -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 = self.edge_points(C_local,k=k,number=number_edge_points)
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,18 +1,26 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: amaazetools
3
- Version: 0.0.8
3
+ Version: 0.1.0
4
4
  Summary: Python package for mesh processing tools developed by AMAAZE
5
- Home-page: https://github.com/jwcalder/AMAAZETools
6
- Author: Jeff Calder
7
- Author-email: jwcalder@umn.edu
8
- License: UNKNOWN
9
- Platform: UNKNOWN
5
+ Author-email: Jeff Calder <jwcalder@umn.edu>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jwcalder/AMAAZETools
8
+ Project-URL: Bug Tracker, https://github.com/jwcalder/AMAAZETools/issues
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Operating System :: OS Independent
13
12
  Requires-Python: >=3.6
14
13
  Description-Content-Type: text/markdown
15
14
  License-File: LICENSE
15
+ Requires-Dist: numpy
16
+ Requires-Dist: scipy
17
+ Requires-Dist: pandas
18
+ Requires-Dist: pydicom
19
+ Requires-Dist: scikit-image
20
+ Requires-Dist: sklearn
21
+ Requires-Dist: matplotlib
22
+ Requires-Dist: graphlearning
23
+ Requires-Dist: plyfile
16
24
 
17
25
  # AMAAZE Tools
18
26
 
@@ -29,7 +37,7 @@ To install the most recent developers version of the package, run
29
37
  git clone https://github.com/jwcalder/AMAAZETools
30
38
  cd AMAAZETools
31
39
  pip install -r requirements.txt
32
- python setup.py install --user
40
+ pip install .
33
41
  ```
34
42
 
35
43
  ## Documentation
@@ -47,5 +55,3 @@ Several people have contributed to the development of this software:
47
55
  1. David Floeder
48
56
  2. Riley O'Neill
49
57
  3. Brendan Cook
50
-
51
-
@@ -1,6 +1,7 @@
1
1
  LICENSE
2
2
  MANIFEST.in
3
3
  README.md
4
+ pyproject.toml
4
5
  setup.py
5
6
  amaazetools/__init__.py
6
7
  amaazetools/dicom.py
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["setuptools","numpy"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+
6
+ [tool.setuptools]
7
+ packages = ['amaazetools']
8
+
9
+
10
+ [project]
11
+ name = "amaazetools"
12
+ version = "0.1.0"
13
+ authors = [
14
+ { name="Jeff Calder", email="jwcalder@umn.edu" },
15
+ ]
16
+ description = "Python package for mesh processing tools developed by AMAAZE"
17
+ readme = "README.md"
18
+ license = {text = "MIT"}
19
+ requires-python = ">=3.6"
20
+ classifiers = [
21
+ "Programming Language :: Python :: 3",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Operating System :: OS Independent",
24
+ ]
25
+ dependencies = ['numpy',
26
+ 'scipy',
27
+ 'pandas',
28
+ 'pydicom',
29
+ 'scikit-image',
30
+ 'sklearn',
31
+ 'matplotlib',
32
+ 'graphlearning',
33
+ 'plyfile'
34
+ ]
35
+
36
+ [project.urls]
37
+ "Homepage" = "https://github.com/jwcalder/AMAAZETools"
38
+ "Bug Tracker" = "https://github.com/jwcalder/AMAAZETools/issues"
@@ -0,0 +1,16 @@
1
+ from setuptools import setup, Extension
2
+ import numpy
3
+
4
+ setup_args = dict(
5
+ ext_modules=[Extension('amaazetools.cextensions',
6
+ sources=['src/cextensions.c',
7
+ 'src/svi_computations.c',
8
+ 'src/mesh_operations.c',
9
+ 'src/memory_allocation.c'],
10
+ include_dirs=[numpy.get_include()],
11
+ extra_compile_args = ['-Ofast'],
12
+ extra_link_args = ['-lm'])])
13
+
14
+ setup(**setup_args)
15
+
16
+
@@ -1,41 +0,0 @@
1
- #This is a setup file
2
- import setuptools
3
- import numpy
4
-
5
-
6
- with open("README.md", "r", encoding="utf-8") as fh:
7
- long_description = fh.read()
8
-
9
- setuptools.setup(
10
- name="amaazetools",
11
- version="0.0.8",
12
- author="Jeff Calder",
13
- author_email="jwcalder@umn.edu",
14
- description="Python package for mesh processing tools developed by AMAAZE",
15
- long_description=long_description,
16
- long_description_content_type="text/markdown",
17
- url="https://github.com/jwcalder/AMAAZETools",
18
- packages=['amaazetools'],
19
- ext_modules=[setuptools.Extension('amaazetools.cextensions',
20
- sources=['src/cextensions.c',
21
- 'src/svi_computations.c',
22
- 'src/mesh_operations.c',
23
- 'src/memory_allocation.c'],
24
- include_dirs=[numpy.get_include()],
25
- extra_compile_args = ['-Ofast'],
26
- extra_link_args = ['-lm'])],
27
- classifiers=["Programming Language :: Python :: 3",
28
- "License :: OSI Approved :: MIT License",
29
- "Operating System :: OS Independent"],
30
- install_requires=['numpy',
31
- 'scipy',
32
- 'pandas',
33
- 'pydicom',
34
- 'scikit-image',
35
- 'sklearn',
36
- 'matplotlib',
37
- 'graphlearning',
38
- 'plyfile'],
39
- python_requires='>=3.6',
40
- )
41
-
File without changes
File without changes
File without changes