nettracer3d 1.0.6__tar.gz → 1.0.7__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 (30) hide show
  1. {nettracer3d-1.0.6/src/nettracer3d.egg-info → nettracer3d-1.0.7}/PKG-INFO +3 -2
  2. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/README.md +3 -2
  3. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/pyproject.toml +1 -1
  4. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/nettracer_gui.py +110 -7
  5. {nettracer3d-1.0.6 → nettracer3d-1.0.7/src/nettracer3d.egg-info}/PKG-INFO +3 -2
  6. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/LICENSE +0 -0
  7. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/setup.cfg +0 -0
  8. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/__init__.py +0 -0
  9. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/cellpose_manager.py +0 -0
  10. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/community_extractor.py +0 -0
  11. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/excelotron.py +0 -0
  12. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/modularity.py +0 -0
  13. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/morphology.py +0 -0
  14. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/neighborhoods.py +0 -0
  15. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/nettracer.py +0 -0
  16. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/network_analysis.py +0 -0
  17. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/network_draw.py +0 -0
  18. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/node_draw.py +0 -0
  19. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/painting.py +0 -0
  20. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/proximity.py +0 -0
  21. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/run.py +0 -0
  22. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/segmenter.py +0 -0
  23. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/segmenter_GPU.py +0 -0
  24. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/simple_network.py +0 -0
  25. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d/smart_dilate.py +0 -0
  26. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d.egg-info/SOURCES.txt +0 -0
  27. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d.egg-info/dependency_links.txt +0 -0
  28. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d.egg-info/entry_points.txt +0 -0
  29. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/src/nettracer3d.egg-info/requires.txt +0 -0
  30. {nettracer3d-1.0.6 → nettracer3d-1.0.7}/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.6
3
+ Version: 1.0.7
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,6 +110,7 @@ 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.5 Updates --
113
+ -- Version 1.0.7 Updates --
114
114
 
115
115
  * Bug fix
116
+ * Added handling if the user tries to load in a multichannel 3dimensional image (note this will not detect if you have a multi-channel image of 2d planes, it will think those are 3d. For now those can be split up with other software, or you can use the crop function to just isolate the channel you want as if it were a z-plane).
@@ -65,6 +65,7 @@ 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.5 Updates --
68
+ -- Version 1.0.7 Updates --
69
69
 
70
- * Bug fix
70
+ * Bug fix
71
+ * Added handling if the user tries to load in a multichannel 3dimensional image (note this will not detect if you have a multi-channel image of 2d planes, it will think those are 3d. For now those can be split up with other software, or you can use the crop function to just isolate the channel you want as if it were a z-plane).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nettracer3d"
3
- version = "1.0.6"
3
+ version = "1.0.7"
4
4
  authors = [
5
5
  { name="Liam McLaughlin", email="liamm@wustl.edu" },
6
6
  ]
@@ -5060,6 +5060,10 @@ class ImageViewerWindow(QMainWindow):
5060
5060
  dialog = MergeNodeIdDialog(self)
5061
5061
  dialog.exec()
5062
5062
 
5063
+ def show_multichan_dialog(self, data):
5064
+ dialog = MultiChanDialog(self, data)
5065
+ dialog.show()
5066
+
5063
5067
  def show_gray_water_dialog(self):
5064
5068
  """Show the gray watershed parameter dialog."""
5065
5069
  dialog = GrayWaterDialog(self)
@@ -5162,7 +5166,7 @@ class ImageViewerWindow(QMainWindow):
5162
5166
 
5163
5167
  my_network.edges = (my_network.nodes == 0) * my_network.edges
5164
5168
 
5165
- my_network.calculate_all(my_network.nodes, my_network.edges, xy_scale = my_network.xy_scale, z_scale = my_network.z_scale, search = None, diledge = None, inners = False, hash_inners = False, remove_trunk = 0, ignore_search_region = True, other_nodes = None, label_nodes = True, directory = None, GPU = False, fast_dil = False, skeletonize = False, GPU_downsample = None)
5169
+ my_network.calculate_all(my_network.nodes, my_network.edges, xy_scale = my_network.xy_scale, z_scale = my_network.z_scale, search = None, diledge = None, inners = False, remove_trunk = 0, ignore_search_region = True, other_nodes = None, label_nodes = True, directory = None, GPU = False, fast_dil = False, skeletonize = False, GPU_downsample = None)
5166
5170
 
5167
5171
  self.load_channel(1, my_network.edges, data = True)
5168
5172
  self.load_channel(0, my_network.nodes, data = True)
@@ -5916,6 +5920,16 @@ class ImageViewerWindow(QMainWindow):
5916
5920
  msg.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
5917
5921
  return msg.exec() == QMessageBox.StandardButton.Yes
5918
5922
 
5923
+ def confirm_multichan_dialog(self):
5924
+ """Shows a dialog asking user to confirm if image is multichan"""
5925
+ msg = QMessageBox()
5926
+ msg.setIcon(QMessageBox.Icon.Question)
5927
+ msg.setText("Image Format Alert")
5928
+ msg.setInformativeText("Is this a Multi-Channel (4D) image?")
5929
+ msg.setWindowTitle("Confirm Image Format")
5930
+ msg.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
5931
+ return msg.exec() == QMessageBox.StandardButton.Yes
5932
+
5919
5933
  def confirm_resize_dialog(self):
5920
5934
  """Shows a dialog asking user to resize image"""
5921
5935
  msg = QMessageBox()
@@ -5999,7 +6013,7 @@ class ImageViewerWindow(QMainWindow):
5999
6013
  try:
6000
6014
  if len(self.channel_data[channel_index].shape) == 3: # potentially 2D RGB
6001
6015
  if self.channel_data[channel_index].shape[-1] in (3, 4): # last dim is 3 or 4
6002
- if not data and self.shape is None:
6016
+ if not data:
6003
6017
  if self.confirm_rgb_dialog():
6004
6018
  # User confirmed it's 2D RGB, expand to 4D
6005
6019
  self.channel_data[channel_index] = np.expand_dims(self.channel_data[channel_index], axis=0)
@@ -6009,12 +6023,18 @@ class ImageViewerWindow(QMainWindow):
6009
6023
  except:
6010
6024
  pass
6011
6025
 
6012
- if not color:
6013
- try:
6014
- if len(self.channel_data[channel_index].shape) == 4 and (channel_index == 0 or channel_index == 1):
6026
+ if len(self.channel_data[channel_index].shape) == 4:
6027
+ if not self.channel_data[channel_index].shape[-1] in (3, 4):
6028
+ if self.confirm_multichan_dialog(): # User is trying to load 4D channel stack:
6029
+ my_data = copy.deepcopy(self.channel_data[channel_index])
6030
+ self.channel_data[channel_index] = None
6031
+ self.show_multichan_dialog(data = my_data)
6032
+ return
6033
+ elif not color and (channel_index == 0 or channel_index == 1):
6034
+ try:
6015
6035
  self.channel_data[channel_index] = self.reduce_rgb_dimension(self.channel_data[channel_index], 'weight')
6016
- except:
6017
- pass
6036
+ except:
6037
+ pass
6018
6038
 
6019
6039
  reset_resize = False
6020
6040
 
@@ -8431,6 +8451,89 @@ class MergeNodeIdDialog(QDialog):
8431
8451
  print(traceback.format_exc())
8432
8452
  #print(f"Error: {e}")
8433
8453
 
8454
+ class MultiChanDialog(QDialog):
8455
+
8456
+ def __init__(self, parent=None, data = None):
8457
+
8458
+ super().__init__(parent)
8459
+ self.setWindowTitle("Channel Loading")
8460
+ self.setModal(False)
8461
+
8462
+ layout = QFormLayout(self)
8463
+
8464
+ self.data = data
8465
+
8466
+ self.nodes = QComboBox()
8467
+ self.edges = QComboBox()
8468
+ self.overlay1 = QComboBox()
8469
+ self.overlay2 = QComboBox()
8470
+ options = ["None"]
8471
+ for i in range(self.data.shape[0]):
8472
+ options.append(str(i))
8473
+ self.nodes.addItems(options)
8474
+ self.edges.addItems(options)
8475
+ self.overlay1.addItems(options)
8476
+ self.overlay2.addItems(options)
8477
+ self.nodes.setCurrentIndex(0)
8478
+ self.edges.setCurrentIndex(0)
8479
+ self.overlay1.setCurrentIndex(0)
8480
+ self.overlay2.setCurrentIndex(0)
8481
+ layout.addRow("Load this channel into nodes?", self.nodes)
8482
+ layout.addRow("Load this channel into edges?", self.edges)
8483
+ layout.addRow("Load this channel into overlay1?", self.overlay1)
8484
+ layout.addRow("Load this channel into overlay2?", self.overlay2)
8485
+
8486
+ run_button = QPushButton("Load Channels")
8487
+ run_button.clicked.connect(self.run)
8488
+ layout.addWidget(run_button)
8489
+
8490
+ run_button2 = QPushButton("Save Channels to Directory")
8491
+ run_button2.clicked.connect(self.run2)
8492
+ layout.addWidget(run_button2)
8493
+
8494
+
8495
+ def run(self):
8496
+
8497
+ try:
8498
+ node_chan = int(self.nodes.currentText())
8499
+ self.parent().load_channel(0, self.data[node_chan, :, :, :], data = True)
8500
+ except:
8501
+ pass
8502
+ try:
8503
+ edge_chan = int(self.edges.currentText())
8504
+ self.parent().load_channel(1, self.data[edge_chan, :, :, :], data = True)
8505
+ except:
8506
+ pass
8507
+ try:
8508
+ overlay1_chan = int(self.overlay1.currentText())
8509
+ self.parent().load_channel(2, self.data[overlay1_chan, :, :, :], data = True)
8510
+ except:
8511
+ pass
8512
+ try:
8513
+ overlay2_chan = int(self.overlay2.currentText())
8514
+ self.parent().load_channel(3, self.data[overlay2_chan, :, :, :], data = True)
8515
+ except:
8516
+ pass
8517
+
8518
+ def run2(self):
8519
+
8520
+ try:
8521
+ # First let user select parent directory
8522
+ parent_dir = QFileDialog.getExistingDirectory(
8523
+ self,
8524
+ "Select Location to Save Channels",
8525
+ "",
8526
+ QFileDialog.Option.ShowDirsOnly
8527
+ )
8528
+
8529
+ for i in range(self.data.shape[0]):
8530
+ try:
8531
+ tifffile.imwrite(f'{parent_dir}/C{i}.tif', self.data[i, :, :, :])
8532
+ except:
8533
+ continue
8534
+ except:
8535
+ pass
8536
+
8434
8537
 
8435
8538
  class Show3dDialog(QDialog):
8436
8539
  def __init__(self, parent=None):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nettracer3d
3
- Version: 1.0.6
3
+ Version: 1.0.7
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,6 +110,7 @@ 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.5 Updates --
113
+ -- Version 1.0.7 Updates --
114
114
 
115
115
  * Bug fix
116
+ * Added handling if the user tries to load in a multichannel 3dimensional image (note this will not detect if you have a multi-channel image of 2d planes, it will think those are 3d. For now those can be split up with other software, or you can use the crop function to just isolate the channel you want as if it were a z-plane).
File without changes
File without changes