nettracer3d 0.4.4__py3-none-any.whl → 0.4.5__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.
@@ -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
- kernel = create_ellipsoidal_kernel(kernel_x, kernel_z)
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.4
3
+ Version: 0.4.5
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,12 +25,26 @@ 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"
31
+ Requires-Dist: torch==2.2.0+cu118; extra == "cuda11"
32
+ Requires-Dist: torchvision==0.17.0+cu118; extra == "cuda11"
33
+ Requires-Dist: torchaudio==2.2.0+cu118; extra == "cuda11"
30
34
  Provides-Extra: cuda12
31
35
  Requires-Dist: cupy-cuda12x; extra == "cuda12"
36
+ Requires-Dist: torch==2.2.0+cu121; extra == "cuda12"
37
+ Requires-Dist: torchvision==0.17.0+cu121; extra == "cuda12"
38
+ Requires-Dist: torchaudio==2.2.0+cu121; extra == "cuda12"
32
39
  Provides-Extra: cupy
33
40
  Requires-Dist: cupy; extra == "cupy"
41
+ Requires-Dist: torch; extra == "cupy"
42
+ Requires-Dist: torchvision; extra == "cupy"
43
+ Requires-Dist: torchaudio; extra == "cupy"
44
+ Provides-Extra: gpu
45
+ Requires-Dist: cupy-cuda11x; (platform_system == "Linux" and platform_machine == "x86_64") and extra == "gpu"
46
+ Requires-Dist: cupy-cuda12x; platform_system == "Windows" and extra == "gpu"
47
+ Requires-Dist: cupy; platform_system == "Darwin" and extra == "gpu"
34
48
 
35
49
  NetTracer3D is a python package developed for both 2D and 3D analysis of microscopic images in the .tif file format. It supports generation of 3D networks showing the relationships between objects (or nodes) in three dimensional space, either based on their own proximity or connectivity via connecting objects such as nerves or blood vessels. In addition to these functionalities are several advanced 3D data processing algorithms, such as labeling of branched structures or abstraction of branched structures into networks. Note that nettracer3d uses segmented data, which can be segmented from other softwares such as ImageJ and imported into NetTracer3D, although it does offer its own segmentation via intensity and volumetric thresholding, or random forest machine learning segmentation. NetTracer3D currently has a fully functional GUI. To use the GUI, after installing the nettracer3d package via pip, enter the command 'nettracer3d' in your command prompt:
36
50
 
@@ -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=x-4xjEJNWzTy5gKvpGAmRzlWD3Wx-lomH_ItqRNv9v8,207727
7
- nettracer3d/nettracer_gui.py,sha256=1b5sFTCe3Jinc200vRTknGsY_Xm2rj-BG2CDyo-gHGU,324790
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=Inp3m6ajgR03zh_JyJt3Qntb-ZXmxuxVDBbmQnhb3pM,11619
13
+ nettracer3d/segmenter.py,sha256=7CqPKxvc6dqu3RoOxUNWFL48CcuV7RwmIzkekqpW6uE,28733
14
14
  nettracer3d/simple_network.py,sha256=fP1gkDdtQcHruEZpUdasKdZeVacoLOxKhR3bY0L1CAQ,15426
15
- nettracer3d/smart_dilate.py,sha256=JALeAZ7LLU2psTuI5wlCZobtDx8I0CfihdoEblwfhOY,23520
16
- nettracer3d-0.4.4.dist-info/LICENSE,sha256=gM207DhJjWrxLuEWXl0Qz5ISbtWDmADfjHp3yC2XISs,888
17
- nettracer3d-0.4.4.dist-info/METADATA,sha256=4os3ofWdAzCFAfKt0LvFlUE4atoVKO26s0OKUq1NO7s,2884
18
- nettracer3d-0.4.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
- nettracer3d-0.4.4.dist-info/entry_points.txt,sha256=Nx1rr_0QhJXDBHAQg2vcqCzLMKBzSHfwy3xwGkueVyc,53
20
- nettracer3d-0.4.4.dist-info/top_level.txt,sha256=zsYy9rZwirfCEOubolhee4TyzqBAL5gSUeFMzhFTX8c,12
21
- nettracer3d-0.4.4.dist-info/RECORD,,
15
+ nettracer3d/smart_dilate.py,sha256=dvbG2UhWzMQrtDqSj281rixNRgwUHOFGlJZ9RSl6rKs,24590
16
+ nettracer3d-0.4.5.dist-info/LICENSE,sha256=gM207DhJjWrxLuEWXl0Qz5ISbtWDmADfjHp3yC2XISs,888
17
+ nettracer3d-0.4.5.dist-info/METADATA,sha256=heriQfrxj6N0iPIgLTqKaVMnC81iUmjFI44dQ4BeyW4,3676
18
+ nettracer3d-0.4.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
+ nettracer3d-0.4.5.dist-info/entry_points.txt,sha256=Nx1rr_0QhJXDBHAQg2vcqCzLMKBzSHfwy3xwGkueVyc,53
20
+ nettracer3d-0.4.5.dist-info/top_level.txt,sha256=zsYy9rZwirfCEOubolhee4TyzqBAL5gSUeFMzhFTX8c,12
21
+ nettracer3d-0.4.5.dist-info/RECORD,,