nettracer3d 0.4.4__py3-none-any.whl → 0.4.6__py3-none-any.whl
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.
- nettracer3d/nettracer.py +47 -3
- nettracer3d/nettracer_gui.py +236 -42
- nettracer3d/segmenter.py +535 -132
- nettracer3d/smart_dilate.py +31 -3
- {nettracer3d-0.4.4.dist-info → nettracer3d-0.4.6.dist-info}/METADATA +3 -2
- {nettracer3d-0.4.4.dist-info → nettracer3d-0.4.6.dist-info}/RECORD +10 -10
- {nettracer3d-0.4.4.dist-info → nettracer3d-0.4.6.dist-info}/LICENSE +0 -0
- {nettracer3d-0.4.4.dist-info → nettracer3d-0.4.6.dist-info}/WHEEL +0 -0
- {nettracer3d-0.4.4.dist-info → nettracer3d-0.4.6.dist-info}/entry_points.txt +0 -0
- {nettracer3d-0.4.4.dist-info → nettracer3d-0.4.6.dist-info}/top_level.txt +0 -0
nettracer3d/smart_dilate.py
CHANGED
|
@@ -19,9 +19,16 @@ except:
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def dilate_3D(tiff_array, dilated_x, dilated_y, dilated_z):
|
|
22
|
-
"""Internal method to dilate an array in 3D.
|
|
22
|
+
"""Internal method to dilate an array in 3D. Dilation this way is much faster than using a distance transform although the latter is theoretically more accurate.
|
|
23
23
|
Arguments are an array, and the desired pixel dilation amounts in X, Y, Z."""
|
|
24
24
|
|
|
25
|
+
if tiff_array.shape[0] == 1:
|
|
26
|
+
return dilate_2D(tiff_array, ((dilated_x - 1) / 2))
|
|
27
|
+
|
|
28
|
+
if dilated_x == 3 and dilated_y == 3 and dilated_z == 3:
|
|
29
|
+
|
|
30
|
+
return dilate_3D_old(tiff_array, dilated_x, dilated_y, dilated_z)
|
|
31
|
+
|
|
25
32
|
def create_circular_kernel(diameter):
|
|
26
33
|
"""Create a 2D circular kernel with a given radius.
|
|
27
34
|
|
|
@@ -85,9 +92,17 @@ def dilate_3D(tiff_array, dilated_x, dilated_y, dilated_z):
|
|
|
85
92
|
dilated_slice = cv2.dilate(tiff_slice, kernel, iterations=1)
|
|
86
93
|
return y, dilated_slice
|
|
87
94
|
|
|
95
|
+
"""
|
|
96
|
+
def process_slice_third(x):
|
|
97
|
+
tiff_slice = tiff_array[:, :, x].astype(np.uint8)
|
|
98
|
+
dilated_slice = cv2.dilate(tiff_slice, kernel, iterations=1)
|
|
99
|
+
return x, dilated_slice
|
|
100
|
+
"""
|
|
101
|
+
|
|
88
102
|
# Create empty arrays to store the dilated results for the XY and XZ planes
|
|
89
103
|
dilated_xy = np.zeros_like(tiff_array, dtype=np.uint8)
|
|
90
104
|
dilated_xz = np.zeros_like(tiff_array, dtype=np.uint8)
|
|
105
|
+
#dilated_yz = np.zeros_like(tiff_array, dtype=np.uint8)
|
|
91
106
|
|
|
92
107
|
kernel_x = int(dilated_x)
|
|
93
108
|
kernel = create_circular_kernel(kernel_x)
|
|
@@ -104,7 +119,10 @@ def dilate_3D(tiff_array, dilated_x, dilated_y, dilated_z):
|
|
|
104
119
|
kernel_x = int(dilated_x)
|
|
105
120
|
kernel_z = int(dilated_z)
|
|
106
121
|
|
|
107
|
-
|
|
122
|
+
if kernel_x == kernel_z:
|
|
123
|
+
kernel = create_circular_kernel(kernel_z)
|
|
124
|
+
else:
|
|
125
|
+
kernel = create_ellipsoidal_kernel(kernel_x, kernel_z)
|
|
108
126
|
|
|
109
127
|
with ThreadPoolExecutor(max_workers=num_cores) as executor:
|
|
110
128
|
futures = {executor.submit(process_slice_other, y): y for y in range(tiff_array.shape[1])}
|
|
@@ -113,8 +131,18 @@ def dilate_3D(tiff_array, dilated_x, dilated_y, dilated_z):
|
|
|
113
131
|
y, dilated_slice = future.result()
|
|
114
132
|
dilated_xz[:, y, :] = dilated_slice
|
|
115
133
|
|
|
134
|
+
"""
|
|
135
|
+
with ThreadPoolExecutor(max_workers=num_cores) as executor:
|
|
136
|
+
futures = {executor.submit(process_slice_other, x): x for x in range(tiff_array.shape[2])}
|
|
137
|
+
|
|
138
|
+
for future in as_completed(futures):
|
|
139
|
+
x, dilated_slice = future.result()
|
|
140
|
+
dilated_yz[:, :, x] = dilated_slice
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
|
|
116
144
|
# Overlay the results
|
|
117
|
-
final_result = dilated_xy | dilated_xz
|
|
145
|
+
final_result = (dilated_xy | dilated_xz)
|
|
118
146
|
|
|
119
147
|
return final_result
|
|
120
148
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: nettracer3d
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
4
4
|
Summary: Scripts for intializing and analyzing networks from segmentations of three dimensional images.
|
|
5
5
|
Author-email: Liam McLaughlin <boom2449@gmail.com>
|
|
6
6
|
Project-URL: User_Manual, https://drive.google.com/drive/folders/1fTkz3n4LN9_VxKRKC8lVQSlrz_wq0bVn?usp=drive_link
|
|
@@ -11,7 +11,7 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: numpy
|
|
14
|
+
Requires-Dist: numpy==1.26.4
|
|
15
15
|
Requires-Dist: scipy
|
|
16
16
|
Requires-Dist: scikit-image
|
|
17
17
|
Requires-Dist: Pillow
|
|
@@ -25,6 +25,7 @@ Requires-Dist: python-louvain
|
|
|
25
25
|
Requires-Dist: tifffile
|
|
26
26
|
Requires-Dist: qtrangeslider
|
|
27
27
|
Requires-Dist: PyQt6
|
|
28
|
+
Requires-Dist: scikit-learn
|
|
28
29
|
Provides-Extra: cuda11
|
|
29
30
|
Requires-Dist: cupy-cuda11x; extra == "cuda11"
|
|
30
31
|
Provides-Extra: cuda12
|
|
@@ -3,19 +3,19 @@ nettracer3d/community_extractor.py,sha256=8bRDJOfZhOFLtpkJVaDQrQ4O8wUywyr-EfVvW5
|
|
|
3
3
|
nettracer3d/hub_getter.py,sha256=KiNtxdajLkwB1ftslvrh1FE1Ch9ZCFEmHSEEotwR-To,8298
|
|
4
4
|
nettracer3d/modularity.py,sha256=V1f3s_vGd8EuVz27mzq6ycIGr0BWIpH7c7NU4QjgAHU,30247
|
|
5
5
|
nettracer3d/morphology.py,sha256=CsRWB0DY-vBBlKdF9IQwgfYYZswuE7n1Iu_Osxgmxnw,13042
|
|
6
|
-
nettracer3d/nettracer.py,sha256=
|
|
7
|
-
nettracer3d/nettracer_gui.py,sha256=
|
|
6
|
+
nettracer3d/nettracer.py,sha256=hDccGy6RybSJFvY6dsN1l5eM3wKZW93CizlTvgEeyNs,209690
|
|
7
|
+
nettracer3d/nettracer_gui.py,sha256=eljw6WT8lcKHRD8RPQZ3uwtovrN4YbCKqPWLMifxuVI,333511
|
|
8
8
|
nettracer3d/network_analysis.py,sha256=MJBBjslA1k_R8ymid77U-qGSgzxFVfzGVQhE0IdhnbE,48046
|
|
9
9
|
nettracer3d/network_draw.py,sha256=F7fw6Pcf4qWOhdKwLmhwqWdschbDlHzwCVolQC9imeU,14117
|
|
10
10
|
nettracer3d/node_draw.py,sha256=BMiD_FrlOHeGD4AQZ_Emd152PfxFuMgGf2x4S0TOTnw,9752
|
|
11
11
|
nettracer3d/proximity.py,sha256=B1pmFegx5Wb0JKI5rvpILv2VRU09f6M2iljAQAqBja0,11059
|
|
12
12
|
nettracer3d/run.py,sha256=xYeaAc8FCx8MuzTGyL3NR3mK7WZzffAYAH23bNRZYO4,127
|
|
13
|
-
nettracer3d/segmenter.py,sha256=
|
|
13
|
+
nettracer3d/segmenter.py,sha256=7CqPKxvc6dqu3RoOxUNWFL48CcuV7RwmIzkekqpW6uE,28733
|
|
14
14
|
nettracer3d/simple_network.py,sha256=fP1gkDdtQcHruEZpUdasKdZeVacoLOxKhR3bY0L1CAQ,15426
|
|
15
|
-
nettracer3d/smart_dilate.py,sha256=
|
|
16
|
-
nettracer3d-0.4.
|
|
17
|
-
nettracer3d-0.4.
|
|
18
|
-
nettracer3d-0.4.
|
|
19
|
-
nettracer3d-0.4.
|
|
20
|
-
nettracer3d-0.4.
|
|
21
|
-
nettracer3d-0.4.
|
|
15
|
+
nettracer3d/smart_dilate.py,sha256=dvbG2UhWzMQrtDqSj281rixNRgwUHOFGlJZ9RSl6rKs,24590
|
|
16
|
+
nettracer3d-0.4.6.dist-info/LICENSE,sha256=gM207DhJjWrxLuEWXl0Qz5ISbtWDmADfjHp3yC2XISs,888
|
|
17
|
+
nettracer3d-0.4.6.dist-info/METADATA,sha256=VPVlkgxFID3-nvAGcwTbuoOhw_tV8xEeu4mtdu3KJ_s,2921
|
|
18
|
+
nettracer3d-0.4.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
19
|
+
nettracer3d-0.4.6.dist-info/entry_points.txt,sha256=Nx1rr_0QhJXDBHAQg2vcqCzLMKBzSHfwy3xwGkueVyc,53
|
|
20
|
+
nettracer3d-0.4.6.dist-info/top_level.txt,sha256=zsYy9rZwirfCEOubolhee4TyzqBAL5gSUeFMzhFTX8c,12
|
|
21
|
+
nettracer3d-0.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|