amaazetools 0.2.0__tar.gz → 0.2.2__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.2.0/amaazetools.egg-info → amaazetools-0.2.2}/PKG-INFO +1 -1
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools/dicom.py +14 -4
- {amaazetools-0.2.0 → amaazetools-0.2.2/amaazetools.egg-info}/PKG-INFO +1 -1
- {amaazetools-0.2.0 → amaazetools-0.2.2}/pyproject.toml +1 -1
- {amaazetools-0.2.0 → amaazetools-0.2.2}/LICENSE +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/MANIFEST.in +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/README.md +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools/__init__.py +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools/edge_detection.py +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools/mesh_segmentation.py +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools/svi.py +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools/trimesh.py +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools.egg-info/SOURCES.txt +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools.egg-info/dependency_links.txt +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools.egg-info/requires.txt +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/amaazetools.egg-info/top_level.txt +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/setup.cfg +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/setup.py +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/cextensions.c +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/memory_allocation.c +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/memory_allocation.h +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/mesh_operations.c +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/mesh_operations.h +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/svi_computations.c +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/svi_computations.h +0 -0
- {amaazetools-0.2.0 → amaazetools-0.2.2}/src/vector_operations.h +0 -0
|
@@ -341,7 +341,7 @@ def imshow(J):
|
|
|
341
341
|
plt.figure()
|
|
342
342
|
plt.imshow(J, cmap='gray')
|
|
343
343
|
|
|
344
|
-
def surface_bones(directory, iso=2500, write_gif=False):
|
|
344
|
+
def surface_bones(directory, iso=2500, write_gif=False, mirror=False):
|
|
345
345
|
""" Processes all npz files in directory creating surface and saving to a ply file.
|
|
346
346
|
|
|
347
347
|
Parameters
|
|
@@ -352,6 +352,8 @@ def surface_bones(directory, iso=2500, write_gif=False):
|
|
|
352
352
|
Iso level to be used for surfacing.
|
|
353
353
|
write_gif : bool (optional), default=False
|
|
354
354
|
Whether to output rotating gifs for each object. Requires mayavi, which can be hard to install.
|
|
355
|
+
mirror : bool (optional), default=False
|
|
356
|
+
Whether to mirror bones when surfacing.
|
|
355
357
|
|
|
356
358
|
Returns
|
|
357
359
|
-------
|
|
@@ -367,6 +369,9 @@ def surface_bones(directory, iso=2500, write_gif=False):
|
|
|
367
369
|
#Rescale image to account for different dx/dz dimensions
|
|
368
370
|
J = rescale(I.astype(float),(dz/dx,1,1),mode='constant')
|
|
369
371
|
|
|
372
|
+
if mirror:
|
|
373
|
+
J = J[::-1,:,:]
|
|
374
|
+
|
|
370
375
|
#Marching cubes for isosurface
|
|
371
376
|
iso_level = iso
|
|
372
377
|
verts,faces,normals,values = tm.marching_cubes(J,iso_level)
|
|
@@ -871,7 +876,7 @@ def seg_adjacency_matrix(u):
|
|
|
871
876
|
return M,X,Y
|
|
872
877
|
|
|
873
878
|
|
|
874
|
-
def surfacing_subproc(filename,directory,iso_level,write_gif=False):
|
|
879
|
+
def surfacing_subproc(filename,directory,iso_level,write_gif=False,miror=False):
|
|
875
880
|
|
|
876
881
|
print('Loading '+filename+'...')
|
|
877
882
|
M = np.load(os.path.join(directory,filename))
|
|
@@ -879,6 +884,9 @@ def surfacing_subproc(filename,directory,iso_level,write_gif=False):
|
|
|
879
884
|
|
|
880
885
|
#Rescale image to account for different dx/dz dimensions
|
|
881
886
|
J = rescale(I.astype(float),(dz/dx,1,1),mode='constant')
|
|
887
|
+
|
|
888
|
+
if mirror:
|
|
889
|
+
J = J[::-1,:,:]
|
|
882
890
|
|
|
883
891
|
try:
|
|
884
892
|
verts,faces,normals,values = tm.marching_cubes(J,iso_level)
|
|
@@ -901,7 +909,7 @@ def surfacing_subproc(filename,directory,iso_level,write_gif=False):
|
|
|
901
909
|
|
|
902
910
|
|
|
903
911
|
|
|
904
|
-
def surface_bones_parallel(directory, iso=2500, write_gif=False,error_fname='./surfacing_errors.csv',ncores='all'):
|
|
912
|
+
def surface_bones_parallel(directory, iso=2500, write_gif=False, mirror=False, error_fname='./surfacing_errors.csv',ncores='all'):
|
|
905
913
|
""" parallelized implementation of surface_bones with also surfacing error support.
|
|
906
914
|
Processes all npz files in directory creating surface and saving to a ply file.
|
|
907
915
|
|
|
@@ -913,6 +921,8 @@ def surface_bones_parallel(directory, iso=2500, write_gif=False,error_fname='./s
|
|
|
913
921
|
Iso level to be used for surfacing.
|
|
914
922
|
write_gif : bool (optional), default=False
|
|
915
923
|
Whether to output rotating gifs for each object. Requires mayavi, which can be hard to install.
|
|
924
|
+
mirror : bool (optional), default=False
|
|
925
|
+
Whether to mirror bones when surfacing.
|
|
916
926
|
error_fname
|
|
917
927
|
|
|
918
928
|
Returns
|
|
@@ -933,7 +943,7 @@ def surface_bones_parallel(directory, iso=2500, write_gif=False,error_fname='./s
|
|
|
933
943
|
else:
|
|
934
944
|
num_cores =multiprocessing.cpu_count()
|
|
935
945
|
|
|
936
|
-
errs = Parallel(n_jobs=num_cores)(delayed(surfacing_subproc)(f,directory,iso,write_gif) for f in fnames)
|
|
946
|
+
errs = Parallel(n_jobs=num_cores)(delayed(surfacing_subproc)(f,directory,iso,mirror,write_gif) for f in fnames)
|
|
937
947
|
|
|
938
948
|
errs = np.array(errs)
|
|
939
949
|
errs = errs[errs!='0']
|
|
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
|
|
File without changes
|