nettracer3d 1.0.9__tar.gz → 1.1.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.

Files changed (31) hide show
  1. {nettracer3d-1.0.9/src/nettracer3d.egg-info → nettracer3d-1.1.1}/PKG-INFO +3 -6
  2. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/README.md +2 -5
  3. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/pyproject.toml +1 -1
  4. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/nettracer.py +32 -28
  5. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/nettracer_gui.py +58 -11
  6. {nettracer3d-1.0.9 → nettracer3d-1.1.1/src/nettracer3d.egg-info}/PKG-INFO +3 -6
  7. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/LICENSE +0 -0
  8. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/setup.cfg +0 -0
  9. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/__init__.py +0 -0
  10. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/cellpose_manager.py +0 -0
  11. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/community_extractor.py +0 -0
  12. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/excelotron.py +0 -0
  13. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/modularity.py +0 -0
  14. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/morphology.py +0 -0
  15. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/neighborhoods.py +0 -0
  16. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/network_analysis.py +0 -0
  17. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/network_draw.py +0 -0
  18. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/node_draw.py +0 -0
  19. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/painting.py +0 -0
  20. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/proximity.py +0 -0
  21. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/run.py +0 -0
  22. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/segmenter.py +0 -0
  23. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/segmenter_GPU.py +0 -0
  24. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/simple_network.py +0 -0
  25. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/smart_dilate.py +0 -0
  26. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d/stats.py +0 -0
  27. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d.egg-info/SOURCES.txt +0 -0
  28. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d.egg-info/dependency_links.txt +0 -0
  29. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d.egg-info/entry_points.txt +0 -0
  30. {nettracer3d-1.0.9 → nettracer3d-1.1.1}/src/nettracer3d.egg-info/requires.txt +0 -0
  31. {nettracer3d-1.0.9 → nettracer3d-1.1.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: 1.0.9
3
+ Version: 1.1.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/
@@ -110,9 +110,6 @@ McLaughlin, L., Zhang, B., Sharma, S. et al. Three dimensional multiscalar neuro
110
110
 
111
111
  NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
112
112
 
113
- -- Version 1.0.9 Updates --
113
+ -- Version 1.1.1 Updates --
114
114
 
115
- * Some bug fixes
116
- * Added ability to load a full sized highlight overlay from the file menu (in case you need it for a picture - on big images the highlight overlay is computed by slice so if you reload the channel its trying to highlight, it will alter the highlight overlay, but loading in the entire highlight overlay directly will stop this behavior until a new highlight is generated).
117
- * For the 'calculate edge < > node interaction' method - now can compute the length of nearby edges as an alternative option to just the volumes.
118
- * Added ability to select all nodes/edges participating in the network.
115
+ * Can now intermittently downsample while making the network and id overlays now to make their relevant elements larger in the actual rendered output.
@@ -65,9 +65,6 @@ McLaughlin, L., Zhang, B., Sharma, S. et al. Three dimensional multiscalar neuro
65
65
 
66
66
  NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
67
67
 
68
- -- Version 1.0.9 Updates --
68
+ -- Version 1.1.1 Updates --
69
69
 
70
- * Some bug fixes
71
- * Added ability to load a full sized highlight overlay from the file menu (in case you need it for a picture - on big images the highlight overlay is computed by slice so if you reload the channel its trying to highlight, it will alter the highlight overlay, but loading in the entire highlight overlay directly will stop this behavior until a new highlight is generated).
72
- * For the 'calculate edge < > node interaction' method - now can compute the length of nearby edges as an alternative option to just the volumes.
73
- * Added ability to select all nodes/edges participating in the network.
70
+ * Can now intermittently downsample while making the network and id overlays now to make their relevant elements larger in the actual rendered output.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nettracer3d"
3
- version = "1.0.9"
3
+ version = "1.1.1"
4
4
  authors = [
5
5
  { name="Liam McLaughlin", email="liamm@wustl.edu" },
6
6
  ]
@@ -3143,13 +3143,14 @@ class Network_3D:
3143
3143
  Can be called on a Network_3D object to save the nodes property to hard mem as a tif. It will save to the active directory if none is specified.
3144
3144
  :param directory: (Optional - Val = None; String). The path to an indended directory to save the nodes to.
3145
3145
  """
3146
- imagej_metadata = {
3147
- 'spacing': self.z_scale,
3148
- 'slices': self._nodes.shape[0],
3149
- 'channels': 1,
3150
- 'axes': 'ZYX'
3151
- }
3152
- resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3146
+ if self._nodes is not None:
3147
+ imagej_metadata = {
3148
+ 'spacing': self.z_scale,
3149
+ 'slices': self._nodes.shape[0],
3150
+ 'channels': 1,
3151
+ 'axes': 'ZYX'
3152
+ }
3153
+ resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3153
3154
 
3154
3155
  if filename is None:
3155
3156
  filename = "labelled_nodes.tif"
@@ -3184,14 +3185,15 @@ class Network_3D:
3184
3185
  :param directory: (Optional - Val = None; String). The path to an indended directory to save the edges to.
3185
3186
  """
3186
3187
 
3187
- imagej_metadata = {
3188
- 'spacing': self.z_scale,
3189
- 'slices': self._edges.shape[0],
3190
- 'channels': 1,
3191
- 'axes': 'ZYX'
3192
- }
3188
+ if self._edges is not None:
3189
+ imagej_metadata = {
3190
+ 'spacing': self.z_scale,
3191
+ 'slices': self._edges.shape[0],
3192
+ 'channels': 1,
3193
+ 'axes': 'ZYX'
3194
+ }
3193
3195
 
3194
- resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3196
+ resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3195
3197
 
3196
3198
  if filename is None:
3197
3199
  filename = "labelled_edges.tif"
@@ -3360,13 +3362,14 @@ class Network_3D:
3360
3362
 
3361
3363
  def save_network_overlay(self, directory = None, filename = None):
3362
3364
 
3363
- imagej_metadata = {
3364
- 'spacing': self.z_scale,
3365
- 'slices': self._network_overlay.shape[0],
3366
- 'channels': 1,
3367
- 'axes': 'ZYX'
3368
- }
3369
- resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3365
+ if self._network_overlay is not None:
3366
+ imagej_metadata = {
3367
+ 'spacing': self.z_scale,
3368
+ 'slices': self._network_overlay.shape[0],
3369
+ 'channels': 1,
3370
+ 'axes': 'ZYX'
3371
+ }
3372
+ resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3370
3373
 
3371
3374
  if filename is None:
3372
3375
  filename = "overlay_1.tif"
@@ -3390,13 +3393,14 @@ class Network_3D:
3390
3393
 
3391
3394
  def save_id_overlay(self, directory = None, filename = None):
3392
3395
 
3393
- imagej_metadata = {
3394
- 'spacing': self.z_scale,
3395
- 'slices': self._id_overlay.shape[0],
3396
- 'channels': 1,
3397
- 'axes': 'ZYX'
3398
- }
3399
- resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3396
+ if self._id_overlay is not None:
3397
+ imagej_metadata = {
3398
+ 'spacing': self.z_scale,
3399
+ 'slices': self._id_overlay.shape[0],
3400
+ 'channels': 1,
3401
+ 'axes': 'ZYX'
3402
+ }
3403
+ resolution_value = 1.0 / self.xy_scale if self.xy_scale != 0 else 1
3400
3404
 
3401
3405
  if filename is None:
3402
3406
  filename = "overlay_2.tif"
@@ -4876,8 +4876,11 @@ class ImageViewerWindow(QMainWindow):
4876
4876
  self.cellpose_launcher.launch_cellpose_gui(use_3d = use_3d)
4877
4877
 
4878
4878
  except:
4879
- import traceback
4880
- print(traceback.format_exc())
4879
+ QMessageBox.critical(
4880
+ self,
4881
+ "Error",
4882
+ f"Error starting cellpose: {str(e)}\nNote: You may need to install cellpose with corresponding torch first - in your environment, please call 'pip install cellpose'. Please see: 'https://pytorch.org/get-started/locally/' to see what torch install command corresponds to your NVIDIA GPU"
4883
+ )
4881
4884
  pass
4882
4885
 
4883
4886
 
@@ -8673,6 +8676,11 @@ class Show3dDialog(QDialog):
8673
8676
  self.accept()
8674
8677
 
8675
8678
  except Exception as e:
8679
+ QMessageBox.critical(
8680
+ self,
8681
+ "Error",
8682
+ f"Error showing 3D: {str(e)}\nNote: You may need to install napari first - in your environment, please call 'pip install napari'"
8683
+ )
8676
8684
  print(f"Error: {e}")
8677
8685
  import traceback
8678
8686
  print(traceback.format_exc())
@@ -8688,6 +8696,9 @@ class NetOverlayDialog(QDialog):
8688
8696
 
8689
8697
  layout = QFormLayout(self)
8690
8698
 
8699
+ self.downsample = QLineEdit("")
8700
+ layout.addRow("Downsample Factor While Drawing? (Int - Makes the outputted lines larger):", self.downsample)
8701
+
8691
8702
  # Add Run button
8692
8703
  run_button = QPushButton("Generate (Will go to Overlay 1)")
8693
8704
  run_button.clicked.connect(self.netoverlay)
@@ -8704,7 +8715,16 @@ class NetOverlayDialog(QDialog):
8704
8715
  if my_network.node_centroids is None:
8705
8716
  return
8706
8717
 
8707
- my_network.network_overlay = my_network.draw_network()
8718
+ try:
8719
+ downsample = float(self.downsample.text()) if self.downsample.text() else None
8720
+ except ValueError:
8721
+ downsample = None
8722
+
8723
+ my_network.network_overlay = my_network.draw_network(down_factor = downsample)
8724
+
8725
+ if downsample is not None:
8726
+ my_network.network_overlay = n3d.upsample_with_padding(my_network.network_overlay, original_shape = self.parent().shape)
8727
+
8708
8728
 
8709
8729
  self.parent().load_channel(2, channel_data = my_network.network_overlay, data = True, preserve_zoom = (self.parent().ax.get_xlim(), self.parent().ax.get_ylim()))
8710
8730
 
@@ -8731,6 +8751,9 @@ class IdOverlayDialog(QDialog):
8731
8751
  self.mode_selector.setCurrentIndex(0) # Default to Mode 1
8732
8752
  layout.addRow("Execution Mode:", self.mode_selector)
8733
8753
 
8754
+ self.downsample = QLineEdit("")
8755
+ layout.addRow("Downsample Factor While Drawing? (Int - Makes the outputted numbers larger):", self.downsample)
8756
+
8734
8757
  # Add Run button
8735
8758
  run_button = QPushButton("Generate (Will go to Overlay 2)")
8736
8759
  run_button.clicked.connect(self.idoverlay)
@@ -8740,6 +8763,11 @@ class IdOverlayDialog(QDialog):
8740
8763
 
8741
8764
  accepted_mode = self.mode_selector.currentIndex()
8742
8765
 
8766
+ try:
8767
+ downsample = float(self.downsample.text()) if self.downsample.text() else None
8768
+ except ValueError:
8769
+ downsample = None
8770
+
8743
8771
  if accepted_mode == 0:
8744
8772
 
8745
8773
  if my_network.node_centroids is None:
@@ -8760,12 +8788,14 @@ class IdOverlayDialog(QDialog):
8760
8788
 
8761
8789
  if accepted_mode == 0:
8762
8790
 
8763
- my_network.id_overlay = my_network.draw_node_indices()
8791
+ my_network.id_overlay = my_network.draw_node_indices(down_factor = downsample)
8764
8792
 
8765
8793
  elif accepted_mode == 1:
8766
8794
 
8767
- my_network.id_overlay = my_network.draw_edge_indices()
8795
+ my_network.id_overlay = my_network.draw_edge_indices(down_factor = downsample)
8768
8796
 
8797
+ if downsample is not None:
8798
+ my_network.id_overlay = n3d.upsample_with_padding(my_network.id_overlay, original_shape = self.parent().shape)
8769
8799
 
8770
8800
  self.parent().load_channel(3, channel_data = my_network.id_overlay, data = True, preserve_zoom = (self.parent().ax.get_xlim(), self.parent().ax.get_ylim()))
8771
8801
 
@@ -8791,7 +8821,7 @@ class ColorOverlayDialog(QDialog):
8791
8821
  layout.addRow("Execution Mode:", self.mode_selector)
8792
8822
 
8793
8823
  self.down_factor = QLineEdit("")
8794
- layout.addRow("down_factor (for speeding up overlay generation - optional):", self.down_factor)
8824
+ layout.addRow("down_factor (int - for speeding up overlay generation - optional):", self.down_factor)
8795
8825
 
8796
8826
  # Add Run button
8797
8827
  run_button = QPushButton("Generate (Will go to Overlay 2)")
@@ -14848,7 +14878,7 @@ class CalcAllDialog(QDialog):
14848
14878
 
14849
14879
  self.down_factor = QLineEdit(self.prev_down_factor)
14850
14880
  self.down_factor.setPlaceholderText("Leave empty for None")
14851
- speedup_layout.addRow("Downsample for Centroids (int):", self.down_factor)
14881
+ speedup_layout.addRow("Downsample for Centroids/Overlays (int):", self.down_factor)
14852
14882
 
14853
14883
  self.GPU_downsample = QLineEdit(self.prev_GPU_downsample)
14854
14884
  self.GPU_downsample.setPlaceholderText("Leave empty for None")
@@ -15006,8 +15036,12 @@ class CalcAllDialog(QDialog):
15006
15036
  directory = 'my_network'
15007
15037
 
15008
15038
  # Generate and update overlays
15009
- my_network.network_overlay = my_network.draw_network(directory=directory)
15010
- my_network.id_overlay = my_network.draw_node_indices(directory=directory)
15039
+ my_network.network_overlay = my_network.draw_network(directory=directory, down_factor = down_factor)
15040
+ my_network.id_overlay = my_network.draw_node_indices(directory=directory, down_factor = down_factor)
15041
+
15042
+ if down_factor is not None:
15043
+ my_network.id_overlay = n3d.upsample_with_padding(my_network.id_overlay, original_shape = self.parent().shape)
15044
+ my_network.network_overlay = n3d.upsample_with_padding(my_network.network_overlay, original_shape = self.parent().shape)
15011
15045
 
15012
15046
  # Update channel data
15013
15047
  self.parent().load_channel(2, my_network.network_overlay, True)
@@ -15128,6 +15162,9 @@ class ProxDialog(QDialog):
15128
15162
  self.overlays.setCheckable(True)
15129
15163
  self.overlays.setChecked(True)
15130
15164
  output_layout.addRow("Generate Overlays:", self.overlays)
15165
+
15166
+ self.downsample = QLineEdit()
15167
+ output_layout.addRow("(If above): Downsample factor for drawing overlays (Int - Makes Overlay Elements Larger):", self.downsample)
15131
15168
 
15132
15169
  self.populate = QPushButton("Populate Nodes from Centroids?")
15133
15170
  self.populate.setCheckable(True)
@@ -15199,6 +15236,12 @@ class ProxDialog(QDialog):
15199
15236
  except:
15200
15237
  max_neighbors = None
15201
15238
 
15239
+
15240
+ try:
15241
+ downsample = int(self.downsample.text()) if self.downsample.text() else None
15242
+ except:
15243
+ downsample = None
15244
+
15202
15245
  overlays = self.overlays.isChecked()
15203
15246
  fastdil = self.fastdil.isChecked()
15204
15247
 
@@ -15254,8 +15297,12 @@ class ProxDialog(QDialog):
15254
15297
  directory = 'my_network'
15255
15298
 
15256
15299
  # Generate and update overlays
15257
- my_network.network_overlay = my_network.draw_network(directory=directory)
15258
- my_network.id_overlay = my_network.draw_node_indices(directory=directory)
15300
+ my_network.network_overlay = my_network.draw_network(directory=directory, down_factor = downsample)
15301
+ my_network.id_overlay = my_network.draw_node_indices(directory=directory, down_factor = downsample)
15302
+
15303
+ if downsample is not None:
15304
+ my_network.id_overlay = n3d.upsample_with_padding(my_network.id_overlay, original_shape = self.parent().shape)
15305
+ my_network.network_overlay = n3d.upsample_with_padding(my_network.network_overlay, original_shape = self.parent().shape)
15259
15306
 
15260
15307
  # Update channel data
15261
15308
  self.parent().load_channel(2, channel_data = my_network.network_overlay, data = True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nettracer3d
3
- Version: 1.0.9
3
+ Version: 1.1.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/
@@ -110,9 +110,6 @@ McLaughlin, L., Zhang, B., Sharma, S. et al. Three dimensional multiscalar neuro
110
110
 
111
111
  NetTracer3D was developed by Liam McLaughlin while working under Dr. Sanjay Jain at Washington University School of Medicine.
112
112
 
113
- -- Version 1.0.9 Updates --
113
+ -- Version 1.1.1 Updates --
114
114
 
115
- * Some bug fixes
116
- * Added ability to load a full sized highlight overlay from the file menu (in case you need it for a picture - on big images the highlight overlay is computed by slice so if you reload the channel its trying to highlight, it will alter the highlight overlay, but loading in the entire highlight overlay directly will stop this behavior until a new highlight is generated).
117
- * For the 'calculate edge < > node interaction' method - now can compute the length of nearby edges as an alternative option to just the volumes.
118
- * Added ability to select all nodes/edges participating in the network.
115
+ * Can now intermittently downsample while making the network and id overlays now to make their relevant elements larger in the actual rendered output.
File without changes
File without changes