celldetective 1.1.0__py3-none-any.whl → 1.1.1__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.
Files changed (32) hide show
  1. celldetective/__main__.py +5 -19
  2. celldetective/extra_properties.py +62 -52
  3. celldetective/gui/control_panel.py +5 -0
  4. celldetective/gui/layouts.py +1 -0
  5. celldetective/gui/measurement_options.py +13 -109
  6. celldetective/gui/plot_signals_ui.py +1 -0
  7. celldetective/gui/process_block.py +1 -1
  8. celldetective/gui/survival_ui.py +7 -1
  9. celldetective/gui/tableUI.py +280 -28
  10. celldetective/gui/thresholds_gui.py +7 -5
  11. celldetective/gui/viewers.py +169 -22
  12. celldetective/io.py +14 -5
  13. celldetective/measure.py +13 -238
  14. celldetective/models/segmentation_effectors/primNK_cfse/config_input.json +29 -0
  15. celldetective/models/segmentation_effectors/primNK_cfse/cp-cfse-transfer +0 -0
  16. celldetective/models/segmentation_effectors/primNK_cfse/training_instructions.json +37 -0
  17. celldetective/neighborhood.py +4 -1
  18. celldetective/preprocessing.py +483 -143
  19. celldetective/scripts/segment_cells.py +15 -4
  20. celldetective/scripts/train_segmentation_model.py +35 -34
  21. celldetective/segmentation.py +14 -9
  22. celldetective/signals.py +13 -231
  23. celldetective/tracking.py +2 -1
  24. celldetective/utils.py +437 -26
  25. {celldetective-1.1.0.dist-info → celldetective-1.1.1.dist-info}/METADATA +1 -1
  26. {celldetective-1.1.0.dist-info → celldetective-1.1.1.dist-info}/RECORD +32 -28
  27. tests/test_preprocessing.py +37 -0
  28. tests/test_utils.py +48 -1
  29. {celldetective-1.1.0.dist-info → celldetective-1.1.1.dist-info}/LICENSE +0 -0
  30. {celldetective-1.1.0.dist-info → celldetective-1.1.1.dist-info}/WHEEL +0 -0
  31. {celldetective-1.1.0.dist-info → celldetective-1.1.1.dist-info}/entry_points.txt +0 -0
  32. {celldetective-1.1.0.dist-info → celldetective-1.1.1.dist-info}/top_level.txt +0 -0
tests/test_utils.py CHANGED
@@ -2,7 +2,7 @@ import unittest
2
2
  import matplotlib.pyplot as plt
3
3
  import numpy as np
4
4
  import os
5
- from celldetective.utils import create_patch_mask, remove_redundant_features, _extract_channel_indices, _get_img_num_per_channel,split_by_ratio,extract_experiment_channels
5
+ from celldetective.utils import create_patch_mask, remove_redundant_features, _extract_channel_indices, _get_img_num_per_channel, split_by_ratio,extract_experiment_channels, estimate_unreliable_edge, unpad, mask_edges
6
6
 
7
7
  class TestPatchMask(unittest.TestCase):
8
8
 
@@ -66,6 +66,53 @@ class TestSplitArrayByRatio(unittest.TestCase):
66
66
  split_array = split_by_ratio(self.array,0.5,0.25,0.1)
67
67
  self.assertTrue(np.all([len(split_array[0])==50, len(split_array[1])==25, len(split_array[2])==10]))
68
68
 
69
+ class TestUnpad(unittest.TestCase):
70
+
71
+ @classmethod
72
+ def setUpClass(self):
73
+ self.array = np.array([[0,0,0],
74
+ [0,1,0],
75
+ [0,0,0]])
76
+
77
+ def test_unpad(self):
78
+ expected_unpad_array = np.array([[1]])
79
+ test_array = unpad(self.array, 1)
80
+ self.assertTrue(np.array_equal(test_array, expected_unpad_array))
81
+
82
+ class TestMaskEdge(unittest.TestCase):
83
+
84
+ @classmethod
85
+ def setUpClass(self):
86
+ self.binary_mask = np.array([[1, 1, 1, 1, 1],
87
+ [1, 1, 1, 1, 1],
88
+ [1, 1, 1, 1, 1],
89
+ [1, 1, 1, 1, 1],
90
+ [1, 1, 1, 1, 1]])
91
+
92
+ def test_mask_edge_properly(self):
93
+ expected_output = np.array([[False, False, False, False, False],
94
+ [False, True, True, True, False],
95
+ [False, True, True, True, False],
96
+ [False, True, True, True, False],
97
+ [False, False, False, False, False]])
98
+ actual_output = mask_edges(self.binary_mask, 1)
99
+ self.assertTrue(np.array_equal(actual_output, expected_output))
100
+
101
+ class TestEstimateFilterEdge(unittest.TestCase):
102
+
103
+ @classmethod
104
+ def setUpClass(self):
105
+ self.protocol1 = [['gauss',2],['std',4]]
106
+ self.expected1 = 6
107
+ self.protocol2 = [['gauss',4],['variance','string_arg']]
108
+ self.expected2 = 4
109
+
110
+ def test_edge_is_estimated_properly_with_only_number_arguments(self):
111
+ self.assertEqual(self.expected1, estimate_unreliable_edge(self.protocol1))
112
+
113
+ def test_edge_is_estimated_properly_with_mixed_arguments(self):
114
+ self.assertEqual(self.expected2, estimate_unreliable_edge(self.protocol2))
115
+
69
116
 
70
117
  if __name__=="__main__":
71
118
  unittest.main()