celldetective 1.3.0__tar.gz → 1.3.0.post1__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.
Files changed (107) hide show
  1. {celldetective-1.3.0 → celldetective-1.3.0.post1}/PKG-INFO +1 -1
  2. celldetective-1.3.0.post1/celldetective/_version.py +1 -0
  3. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/classifier_widget.py +9 -4
  4. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/io.py +4 -1
  5. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/measure.py +5 -5
  6. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/PKG-INFO +1 -1
  7. celldetective-1.3.0/celldetective/_version.py +0 -1
  8. {celldetective-1.3.0 → celldetective-1.3.0.post1}/LICENSE +0 -0
  9. {celldetective-1.3.0 → celldetective-1.3.0.post1}/README.md +0 -0
  10. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/__init__.py +0 -0
  11. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/__main__.py +0 -0
  12. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/datasets/segmentation_annotations/blank +0 -0
  13. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/datasets/signal_annotations/blank +0 -0
  14. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/events.py +0 -0
  15. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/extra_properties.py +0 -0
  16. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/filters.py +0 -0
  17. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/InitWindow.py +0 -0
  18. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/__init__.py +0 -0
  19. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/about.py +0 -0
  20. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/analyze_block.py +0 -0
  21. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/btrack_options.py +0 -0
  22. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/configure_new_exp.py +0 -0
  23. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/control_panel.py +0 -0
  24. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/generic_signal_plot.py +0 -0
  25. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/gui_utils.py +0 -0
  26. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/DL-segmentation-strategy.json +0 -0
  27. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/Threshold-vs-DL.json +0 -0
  28. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/cell-populations.json +0 -0
  29. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/exp-structure.json +0 -0
  30. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/feature-btrack.json +0 -0
  31. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/neighborhood.json +0 -0
  32. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/prefilter-for-segmentation.json +0 -0
  33. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/preprocessing.json +0 -0
  34. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/propagate-classification.json +0 -0
  35. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/track-postprocessing.json +0 -0
  36. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/help/tracking.json +0 -0
  37. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/json_readers.py +0 -0
  38. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/layouts.py +0 -0
  39. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/measurement_options.py +0 -0
  40. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/neighborhood_options.py +0 -0
  41. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/plot_measurements.py +0 -0
  42. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/plot_signals_ui.py +0 -0
  43. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/process_block.py +0 -0
  44. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/retrain_segmentation_model_options.py +0 -0
  45. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/retrain_signal_model_options.py +0 -0
  46. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/seg_model_loader.py +0 -0
  47. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/signal_annotator.py +0 -0
  48. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/signal_annotator2.py +0 -0
  49. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/signal_annotator_options.py +0 -0
  50. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/styles.py +0 -0
  51. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/survival_ui.py +0 -0
  52. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/tableUI.py +0 -0
  53. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/thresholds_gui.py +0 -0
  54. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/gui/viewers.py +0 -0
  55. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/logo-large.png +0 -0
  56. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/logo.png +0 -0
  57. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/signals_icon.png +0 -0
  58. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/splash-test.png +0 -0
  59. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/splash.png +0 -0
  60. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/splash0.png +0 -0
  61. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/survival2.png +0 -0
  62. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/vignette_signals2.png +0 -0
  63. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/icons/vignette_signals2.svg +0 -0
  64. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/links/zenodo.json +0 -0
  65. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/pair_signal_detection/blank +0 -0
  66. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/segmentation_effectors/blank +0 -0
  67. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/segmentation_generic/blank +0 -0
  68. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/segmentation_targets/blank +0 -0
  69. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/signal_detection/blank +0 -0
  70. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/tracking_configs/mcf7.json +0 -0
  71. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/tracking_configs/ricm.json +0 -0
  72. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/models/tracking_configs/ricm2.json +0 -0
  73. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/neighborhood.py +0 -0
  74. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/preprocessing.py +0 -0
  75. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/relative_measurements.py +0 -0
  76. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/analyze_signals.py +0 -0
  77. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/measure_cells.py +0 -0
  78. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/measure_relative.py +0 -0
  79. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/segment_cells.py +0 -0
  80. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/segment_cells_thresholds.py +0 -0
  81. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/track_cells.py +0 -0
  82. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/train_segmentation_model.py +0 -0
  83. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/scripts/train_signal_model.py +0 -0
  84. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/segmentation.py +0 -0
  85. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/signals.py +0 -0
  86. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/tracking.py +0 -0
  87. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective/utils.py +0 -0
  88. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/SOURCES.txt +0 -0
  89. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/dependency_links.txt +0 -0
  90. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/entry_points.txt +0 -0
  91. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/not-zip-safe +0 -0
  92. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/requires.txt +0 -0
  93. {celldetective-1.3.0 → celldetective-1.3.0.post1}/celldetective.egg-info/top_level.txt +0 -0
  94. {celldetective-1.3.0 → celldetective-1.3.0.post1}/setup.cfg +0 -0
  95. {celldetective-1.3.0 → celldetective-1.3.0.post1}/setup.py +0 -0
  96. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/__init__.py +0 -0
  97. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_events.py +0 -0
  98. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_filters.py +0 -0
  99. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_io.py +0 -0
  100. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_measure.py +0 -0
  101. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_neighborhood.py +0 -0
  102. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_preprocessing.py +0 -0
  103. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_qt.py +0 -0
  104. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_segmentation.py +0 -0
  105. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_signals.py +0 -0
  106. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_tracking.py +0 -0
  107. {celldetective-1.3.0 → celldetective-1.3.0.post1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: celldetective
3
- Version: 1.3.0
3
+ Version: 1.3.0.post1
4
4
  Summary: description
5
5
  Home-page: http://github.com/remyeltorro/celldetective
6
6
  Author: Rémy Torro
@@ -0,0 +1 @@
1
+ __version__ = "1.3.0.post1"
@@ -242,18 +242,20 @@ class ClassifierWidget(QWidget, Styles):
242
242
 
243
243
  def update_props_scatter(self, feature_changed=True):
244
244
 
245
+ class_name = self.class_name
246
+
245
247
  try:
246
248
 
247
249
  if not self.project_times:
248
250
  self.scat_props.set_offsets(self.df.loc[self.df['FRAME']==self.currentFrame,[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
249
- colors = [color_from_status(c) for c in self.df.loc[self.df['FRAME']==self.currentFrame,self.class_name].to_numpy()]
251
+ colors = [color_from_status(c) for c in self.df.loc[self.df['FRAME']==self.currentFrame,class_name].to_numpy()]
250
252
  self.scat_props.set_facecolor(colors)
251
253
  self.scat_props.set_alpha(self.currentAlpha)
252
254
  self.ax_props.set_xlabel(self.features_cb[1].currentText())
253
255
  self.ax_props.set_ylabel(self.features_cb[0].currentText())
254
256
  else:
255
257
  self.scat_props.set_offsets(self.df[[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
256
- colors = [color_from_status(c) for c in self.df[self.class_name].to_numpy()]
258
+ colors = [color_from_status(c) for c in self.df[class_name].to_numpy()]
257
259
  self.scat_props.set_facecolor(colors)
258
260
  self.scat_props.set_alpha(self.currentAlpha)
259
261
  self.ax_props.set_xlabel(self.features_cb[1].currentText())
@@ -282,7 +284,8 @@ class ClassifierWidget(QWidget, Styles):
282
284
  def apply_property_query(self):
283
285
 
284
286
  query = self.property_query_le.text()
285
- self.df = classify_cells_from_query(self.df, self.class_name, query)
287
+ self.df = classify_cells_from_query(self.df, self.name_le.text(), query)
288
+ self.class_name = "status_"+self.name_le.text()
286
289
  if self.df is None:
287
290
  msgBox = QMessageBox()
288
291
  msgBox.setIcon(QMessageBox.Warning)
@@ -292,7 +295,6 @@ class ClassifierWidget(QWidget, Styles):
292
295
  returnValue = msgBox.exec()
293
296
  if returnValue == QMessageBox.Ok:
294
297
  return None
295
-
296
298
  self.update_props_scatter()
297
299
 
298
300
  def set_frame(self, value):
@@ -351,6 +353,7 @@ class ClassifierWidget(QWidget, Styles):
351
353
  return None
352
354
 
353
355
  name_map = {self.class_name: self.class_name_user}
356
+ print(f"{name_map=}")
354
357
  self.df = self.df.drop(list(set(name_map.values()) & set(self.df.columns)), axis=1).rename(columns=name_map)
355
358
  self.df.reset_index(inplace=True, drop=True)
356
359
 
@@ -379,6 +382,8 @@ class ClassifierWidget(QWidget, Styles):
379
382
  #self.df[self.group_name_user] = self.df[self.group_name_user].replace({0: 1, 1: 0})
380
383
  self.df.reset_index(inplace=True, drop=True)
381
384
 
385
+ if 'custom' in list(self.df.columns):
386
+ self.df = self.df.drop(['custom'],axis=1)
382
387
 
383
388
  for pos,pos_group in self.df.groupby('position'):
384
389
  pos_group.to_csv(pos+os.sep.join(['output', 'tables', f'trajectories_{self.mode}.csv']), index=False)
@@ -766,6 +766,9 @@ def locate_stack_and_labels(position, prefix='Aligned', population="target"):
766
766
  position = position.replace('\\', '/')
767
767
  labels = locate_labels(position, population=population)
768
768
  stack = locate_stack(position, prefix=prefix)
769
+ if len(labels) < len(stack):
770
+ fix_missing_labels(position, population=population, prefix=prefix)
771
+ labels = locate_labels(position, population=population)
769
772
  assert len(stack) == len(
770
773
  labels), f"The shape of the stack {stack.shape} does not match with the shape of the labels {labels.shape}"
771
774
 
@@ -1272,7 +1275,7 @@ def view_on_napari_btrack(data, properties, graph, stack=None, labels=None, rela
1272
1275
  if stack is not None:
1273
1276
  viewer.add_image(stack, channel_axis=-1, colormap=["gray"] * stack.shape[-1])
1274
1277
  if labels is not None:
1275
- viewer.add_labels(labels, name='segmentation', opacity=0.4)
1278
+ viewer.add_labels(labels.astype(int), name='segmentation', opacity=0.4)
1276
1279
  viewer.add_points(vertices, size=4, name='points', opacity=0.3)
1277
1280
  if data.shape[1]==4:
1278
1281
  viewer.add_tracks(data, properties=properties, graph=graph, name='tracks')
@@ -1338,10 +1338,11 @@ def classify_cells_from_query(df, status_attr, query):
1338
1338
  if not status_attr.startswith('status_'):
1339
1339
  status_attr = 'status_'+status_attr
1340
1340
 
1341
- df[status_attr] = 0
1341
+ df = df.copy()
1342
+ df.loc[:,status_attr] = 0
1343
+
1342
1344
  cols = extract_cols_from_query(query)
1343
1345
  cols_in_df = np.all([c in list(df.columns) for c in cols], axis=0)
1344
-
1345
1346
  if query=='':
1346
1347
  print('The provided query is empty...')
1347
1348
  else:
@@ -1354,11 +1355,10 @@ def classify_cells_from_query(df, status_attr, query):
1354
1355
  df.loc[selection, status_attr] = 1
1355
1356
  else:
1356
1357
  df.loc[:, status_attr] = np.nan
1357
-
1358
1358
  except Exception as e:
1359
- print("The query could not be understood. No filtering was applied. {e}...")
1359
+ print(f"The query could not be understood. No filtering was applied. {e}...")
1360
1360
  return None
1361
- return df
1361
+ return df.copy()
1362
1362
 
1363
1363
  def classify_tracks_from_query(df, event_name, query, irreversible_event=True, unique_state=False, r2_threshold=0.5, percentile_recovery=50):
1364
1364
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: celldetective
3
- Version: 1.3.0
3
+ Version: 1.3.0.post1
4
4
  Summary: description
5
5
  Home-page: http://github.com/remyeltorro/celldetective
6
6
  Author: Rémy Torro
@@ -1 +0,0 @@
1
- __version__ = "1.3.0"