nettracer3d 1.2.7__py3-none-any.whl → 1.3.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/branch_stitcher.py +245 -142
- nettracer3d/community_extractor.py +3 -2
- nettracer3d/endpoint_joiner.py +286 -0
- nettracer3d/filaments.py +348 -106
- nettracer3d/histos.py +1182 -0
- nettracer3d/modularity.py +14 -96
- nettracer3d/neighborhoods.py +3 -2
- nettracer3d/nettracer.py +296 -82
- nettracer3d/nettracer_gui.py +2275 -2770
- nettracer3d/network_analysis.py +28 -9
- nettracer3d/network_graph_widget.py +2267 -0
- nettracer3d/painting.py +158 -298
- nettracer3d/segmenter.py +1 -1
- nettracer3d/segmenter_GPU.py +0 -1
- nettracer3d/simple_network.py +4 -4
- nettracer3d/smart_dilate.py +19 -7
- nettracer3d/tutorial.py +77 -26
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.6.dist-info}/METADATA +50 -18
- nettracer3d-1.3.6.dist-info/RECORD +32 -0
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.6.dist-info}/WHEEL +1 -1
- nettracer3d-1.2.7.dist-info/RECORD +0 -29
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.6.dist-info}/entry_points.txt +0 -0
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.6.dist-info}/licenses/LICENSE +0 -0
- {nettracer3d-1.2.7.dist-info → nettracer3d-1.3.6.dist-info}/top_level.txt +0 -0
nettracer3d/network_analysis.py
CHANGED
|
@@ -442,6 +442,17 @@ def combine_lists_to_sublists(master_list):
|
|
|
442
442
|
|
|
443
443
|
return combined_list
|
|
444
444
|
|
|
445
|
+
def combine_lists_to_sublists_no_edges(master_list):
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
list1 = master_list[0]
|
|
449
|
+
list2 = master_list[1]
|
|
450
|
+
|
|
451
|
+
# Combine the lists into one list of sublists
|
|
452
|
+
combined_list = [list(sublist) for sublist in zip(list1, list2)]
|
|
453
|
+
|
|
454
|
+
return combined_list
|
|
455
|
+
|
|
445
456
|
|
|
446
457
|
def find_centroids(nodes, down_factor = None, network = None):
|
|
447
458
|
|
|
@@ -867,11 +878,7 @@ def buckets(dists, num_objects, rad_dist, directory = None):
|
|
|
867
878
|
|
|
868
879
|
try:
|
|
869
880
|
|
|
870
|
-
if directory is None:
|
|
871
|
-
# Save the DataFrame to an Excel file
|
|
872
|
-
df.to_excel('radial_distribution.xlsx', index=False)
|
|
873
|
-
print("Radial distribution saved to radial_distribution.xlsx")
|
|
874
|
-
else:
|
|
881
|
+
if directory is not None:
|
|
875
882
|
df.to_excel(f'{directory}/radial_distribution.xlsx', index=False)
|
|
876
883
|
print(f"Radial distribution saved to {directory}/radial_distribution.xlsx")
|
|
877
884
|
except:
|
|
@@ -923,8 +930,15 @@ def get_distance_list(centroids, network, xy_scale, z_scale):
|
|
|
923
930
|
return distance_list
|
|
924
931
|
|
|
925
932
|
|
|
926
|
-
def prune_samenode_connections(networkfile, nodeIDs):
|
|
927
|
-
"""Even faster numpy-based version for very large datasets
|
|
933
|
+
def prune_samenode_connections(networkfile, nodeIDs, target=None):
|
|
934
|
+
"""Even faster numpy-based version for very large datasets
|
|
935
|
+
|
|
936
|
+
Args:
|
|
937
|
+
networkfile: Network file path or list of node pairs
|
|
938
|
+
nodeIDs: Node identity mapping (file path or dict)
|
|
939
|
+
target: Optional string. If provided, only prunes pairs where BOTH nodes
|
|
940
|
+
have this specific identity. If None, prunes all same-identity pairs.
|
|
941
|
+
"""
|
|
928
942
|
import numpy as np
|
|
929
943
|
|
|
930
944
|
# Handle nodeIDs input
|
|
@@ -953,8 +967,13 @@ def prune_samenode_connections(networkfile, nodeIDs):
|
|
|
953
967
|
idsA = np.array([data_dict.get(node) for node in nodesA])
|
|
954
968
|
idsB = np.array([data_dict.get(node) for node in nodesB])
|
|
955
969
|
|
|
956
|
-
# Create boolean mask
|
|
957
|
-
|
|
970
|
+
# Create boolean mask based on target parameter
|
|
971
|
+
if target is None:
|
|
972
|
+
# Original behavior: keep where IDs are different
|
|
973
|
+
keep_mask = idsA != idsB
|
|
974
|
+
else:
|
|
975
|
+
# New behavior: only remove pairs where BOTH nodes have the target identity
|
|
976
|
+
keep_mask = ~((idsA == target) & (idsB == target))
|
|
958
977
|
|
|
959
978
|
# Apply filter
|
|
960
979
|
filtered_nodesA = nodesA[keep_mask].tolist()
|