celldetective 1.1.0__py3-none-any.whl → 1.1.1.post1__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.
- celldetective/__main__.py +5 -19
- celldetective/extra_properties.py +63 -53
- celldetective/filters.py +39 -11
- celldetective/gui/classifier_widget.py +56 -7
- celldetective/gui/control_panel.py +5 -0
- celldetective/gui/layouts.py +3 -2
- celldetective/gui/measurement_options.py +13 -109
- celldetective/gui/plot_signals_ui.py +1 -0
- celldetective/gui/process_block.py +1 -1
- celldetective/gui/survival_ui.py +7 -1
- celldetective/gui/tableUI.py +294 -28
- celldetective/gui/thresholds_gui.py +51 -10
- celldetective/gui/viewers.py +169 -22
- celldetective/io.py +41 -17
- celldetective/measure.py +13 -238
- celldetective/models/segmentation_effectors/primNK_cfse/config_input.json +29 -0
- celldetective/models/segmentation_effectors/primNK_cfse/cp-cfse-transfer +0 -0
- celldetective/models/segmentation_effectors/primNK_cfse/training_instructions.json +37 -0
- celldetective/neighborhood.py +4 -1
- celldetective/preprocessing.py +483 -143
- celldetective/scripts/segment_cells.py +26 -7
- celldetective/scripts/train_segmentation_model.py +35 -34
- celldetective/segmentation.py +29 -20
- celldetective/signals.py +13 -231
- celldetective/tracking.py +2 -1
- celldetective/utils.py +440 -26
- {celldetective-1.1.0.dist-info → celldetective-1.1.1.post1.dist-info}/METADATA +1 -1
- {celldetective-1.1.0.dist-info → celldetective-1.1.1.post1.dist-info}/RECORD +34 -30
- {celldetective-1.1.0.dist-info → celldetective-1.1.1.post1.dist-info}/WHEEL +1 -1
- tests/test_preprocessing.py +37 -0
- tests/test_utils.py +48 -1
- {celldetective-1.1.0.dist-info → celldetective-1.1.1.post1.dist-info}/LICENSE +0 -0
- {celldetective-1.1.0.dist-info → celldetective-1.1.1.post1.dist-info}/entry_points.txt +0 -0
- {celldetective-1.1.0.dist-info → celldetective-1.1.1.post1.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()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|