nettracer3d 1.2.7__py3-none-any.whl → 1.3.1__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/branch_stitcher.py +245 -142
- nettracer3d/nettracer.py +205 -32
- nettracer3d/nettracer_gui.py +1975 -2026
- nettracer3d/network_analysis.py +16 -4
- nettracer3d/network_graph_widget.py +2066 -0
- nettracer3d/painting.py +158 -298
- nettracer3d/simple_network.py +4 -4
- nettracer3d/smart_dilate.py +19 -7
- nettracer3d/tutorial.py +38 -3
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.1.dist-info}/METADATA +51 -17
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.1.dist-info}/RECORD +15 -14
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.1.dist-info}/WHEEL +0 -0
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.1.dist-info}/entry_points.txt +0 -0
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.1.dist-info}/licenses/LICENSE +0 -0
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.1.dist-info}/top_level.txt +0 -0
nettracer3d/network_analysis.py
CHANGED
|
@@ -923,8 +923,15 @@ def get_distance_list(centroids, network, xy_scale, z_scale):
|
|
|
923
923
|
return distance_list
|
|
924
924
|
|
|
925
925
|
|
|
926
|
-
def prune_samenode_connections(networkfile, nodeIDs):
|
|
927
|
-
"""Even faster numpy-based version for very large datasets
|
|
926
|
+
def prune_samenode_connections(networkfile, nodeIDs, target=None):
|
|
927
|
+
"""Even faster numpy-based version for very large datasets
|
|
928
|
+
|
|
929
|
+
Args:
|
|
930
|
+
networkfile: Network file path or list of node pairs
|
|
931
|
+
nodeIDs: Node identity mapping (file path or dict)
|
|
932
|
+
target: Optional string. If provided, only prunes pairs where BOTH nodes
|
|
933
|
+
have this specific identity. If None, prunes all same-identity pairs.
|
|
934
|
+
"""
|
|
928
935
|
import numpy as np
|
|
929
936
|
|
|
930
937
|
# Handle nodeIDs input
|
|
@@ -953,8 +960,13 @@ def prune_samenode_connections(networkfile, nodeIDs):
|
|
|
953
960
|
idsA = np.array([data_dict.get(node) for node in nodesA])
|
|
954
961
|
idsB = np.array([data_dict.get(node) for node in nodesB])
|
|
955
962
|
|
|
956
|
-
# Create boolean mask
|
|
957
|
-
|
|
963
|
+
# Create boolean mask based on target parameter
|
|
964
|
+
if target is None:
|
|
965
|
+
# Original behavior: keep where IDs are different
|
|
966
|
+
keep_mask = idsA != idsB
|
|
967
|
+
else:
|
|
968
|
+
# New behavior: only remove pairs where BOTH nodes have the target identity
|
|
969
|
+
keep_mask = ~((idsA == target) & (idsB == target))
|
|
958
970
|
|
|
959
971
|
# Apply filter
|
|
960
972
|
filtered_nodesA = nodesA[keep_mask].tolist()
|