nettracer3d 0.7.9__tar.gz → 0.8.1__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.
Potentially problematic release.
This version of nettracer3d might be problematic. Click here for more details.
- {nettracer3d-0.7.9/src/nettracer3d.egg-info → nettracer3d-0.8.1}/PKG-INFO +5 -3
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/README.md +4 -2
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/pyproject.toml +1 -1
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/community_extractor.py +17 -26
- nettracer3d-0.8.1/src/nettracer3d/neighborhoods.py +691 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/nettracer.py +230 -39
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/nettracer_gui.py +1195 -202
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/node_draw.py +22 -12
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/proximity.py +83 -6
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/segmenter.py +1 -1
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/segmenter_GPU.py +1 -1
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/simple_network.py +43 -25
- {nettracer3d-0.7.9 → nettracer3d-0.8.1/src/nettracer3d.egg-info}/PKG-INFO +5 -3
- nettracer3d-0.7.9/src/nettracer3d/neighborhoods.py +0 -354
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/LICENSE +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/setup.cfg +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/__init__.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/excelotron.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/modularity.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/morphology.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/network_analysis.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/network_draw.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/run.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d/smart_dilate.py +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d.egg-info/SOURCES.txt +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d.egg-info/dependency_links.txt +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d.egg-info/entry_points.txt +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d.egg-info/requires.txt +0 -0
- {nettracer3d-0.7.9 → nettracer3d-0.8.1}/src/nettracer3d.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nettracer3d
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Scripts for intializing and analyzing networks from segmentations of three dimensional images.
|
|
5
5
|
Author-email: Liam McLaughlin <liamm@wustl.edu>
|
|
6
6
|
Project-URL: Documentation, https://nettracer3d.readthedocs.io/en/latest/
|
|
@@ -73,6 +73,8 @@ NetTracer3D is free to use/fork for academic/nonprofit use so long as citation i
|
|
|
73
73
|
|
|
74
74
|
NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
|
|
75
75
|
|
|
76
|
-
-- Version 0.
|
|
76
|
+
-- Version 0.8.1 Updates --
|
|
77
77
|
|
|
78
|
-
*
|
|
78
|
+
* Added nearest neighbor evaluation function (Analysis -> Stats -> Avg Nearest Neighbor)
|
|
79
|
+
* Added heatmap outputs for node degrees (Analysis -> Data/Overlays -> Get Degree Information).
|
|
80
|
+
* Bug fixes and misc improvements.
|
|
@@ -34,6 +34,8 @@ NetTracer3D is free to use/fork for academic/nonprofit use so long as citation i
|
|
|
34
34
|
|
|
35
35
|
NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
|
|
36
36
|
|
|
37
|
-
-- Version 0.
|
|
37
|
+
-- Version 0.8.1 Updates --
|
|
38
38
|
|
|
39
|
-
*
|
|
39
|
+
* Added nearest neighbor evaluation function (Analysis -> Stats -> Avg Nearest Neighbor)
|
|
40
|
+
* Added heatmap outputs for node degrees (Analysis -> Data/Overlays -> Get Degree Information).
|
|
41
|
+
* Bug fixes and misc improvements.
|
|
@@ -492,48 +492,39 @@ def generate_distinct_colors(n_colors: int) -> List[Tuple[int, int, int]]:
|
|
|
492
492
|
return colors
|
|
493
493
|
|
|
494
494
|
def assign_node_colors(node_list: List[int], labeled_array: np.ndarray) -> Tuple[np.ndarray, Dict[int, str]]:
|
|
495
|
-
"""
|
|
496
|
-
Assign distinct colors to nodes and create an RGBA image.
|
|
497
|
-
|
|
498
|
-
Args:
|
|
499
|
-
node_list: List of node IDs
|
|
500
|
-
labeled_array: 3D numpy array with labels corresponding to node IDs
|
|
495
|
+
"""fast version using lookup table approach."""
|
|
501
496
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
"""
|
|
505
|
-
|
|
506
|
-
# Sort communities by size (descending)
|
|
507
|
-
sorted_nodes= sorted(node_list, reverse=True)
|
|
497
|
+
# Sort nodes by size (descending)
|
|
498
|
+
sorted_nodes = sorted(node_list, reverse=True)
|
|
508
499
|
|
|
509
500
|
# Generate distinct colors
|
|
510
501
|
colors = generate_distinct_colors(len(node_list))
|
|
511
|
-
random.shuffle(colors)
|
|
502
|
+
random.shuffle(colors) # Randomly sorted to make adjacent structures likely stand out
|
|
512
503
|
|
|
513
504
|
# Convert RGB colors to RGBA by adding alpha channel
|
|
514
|
-
colors_rgba = [(r, g, b, 255) for r, g, b in colors]
|
|
505
|
+
colors_rgba = np.array([(r, g, b, 255) for r, g, b in colors], dtype=np.uint8)
|
|
515
506
|
|
|
516
|
-
# Create mapping from
|
|
507
|
+
# Create mapping from node to color
|
|
517
508
|
node_to_color = {node: colors_rgba[i] for i, node in enumerate(sorted_nodes)}
|
|
518
509
|
|
|
519
|
-
# Create
|
|
520
|
-
|
|
510
|
+
# Create lookup table
|
|
511
|
+
max_label = max(max(labeled_array.flat), max(node_list) if node_list else 0)
|
|
512
|
+
color_lut = np.zeros((max_label + 1, 4), dtype=np.uint8) # Transparent by default
|
|
521
513
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
# Convert the RGB portion of community_to_color back to RGB for color naming
|
|
514
|
+
for node_id, color in node_to_color.items():
|
|
515
|
+
color_lut[node_id] = color
|
|
516
|
+
|
|
517
|
+
# Single vectorized operation - eliminates all loops!
|
|
518
|
+
rgba_array = color_lut[labeled_array]
|
|
519
|
+
|
|
520
|
+
# Convert colors for naming
|
|
530
521
|
node_to_color_rgb = {k: tuple(v[:3]) for k, v in node_to_color.items()}
|
|
531
522
|
node_to_color_names = convert_node_colors_to_names(node_to_color_rgb)
|
|
532
523
|
|
|
533
524
|
return rgba_array, node_to_color_names
|
|
534
525
|
|
|
535
526
|
def assign_community_colors(community_dict: Dict[int, int], labeled_array: np.ndarray) -> Tuple[np.ndarray, Dict[int, str]]:
|
|
536
|
-
"""
|
|
527
|
+
"""fast version using lookup table approach."""
|
|
537
528
|
|
|
538
529
|
# Same setup as before
|
|
539
530
|
communities = set(community_dict.values())
|