celldetective 1.0.2__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/__init__.py +2 -0
- celldetective/__main__.py +432 -0
- celldetective/datasets/segmentation_annotations/blank +0 -0
- celldetective/datasets/signal_annotations/blank +0 -0
- celldetective/events.py +149 -0
- celldetective/extra_properties.py +100 -0
- celldetective/filters.py +89 -0
- celldetective/gui/__init__.py +20 -0
- celldetective/gui/about.py +44 -0
- celldetective/gui/analyze_block.py +563 -0
- celldetective/gui/btrack_options.py +898 -0
- celldetective/gui/classifier_widget.py +386 -0
- celldetective/gui/configure_new_exp.py +532 -0
- celldetective/gui/control_panel.py +438 -0
- celldetective/gui/gui_utils.py +495 -0
- celldetective/gui/json_readers.py +113 -0
- celldetective/gui/measurement_options.py +1425 -0
- celldetective/gui/neighborhood_options.py +452 -0
- celldetective/gui/plot_signals_ui.py +1042 -0
- celldetective/gui/process_block.py +1055 -0
- celldetective/gui/retrain_segmentation_model_options.py +706 -0
- celldetective/gui/retrain_signal_model_options.py +643 -0
- celldetective/gui/seg_model_loader.py +460 -0
- celldetective/gui/signal_annotator.py +2388 -0
- celldetective/gui/signal_annotator_options.py +340 -0
- celldetective/gui/styles.py +217 -0
- celldetective/gui/survival_ui.py +903 -0
- celldetective/gui/tableUI.py +608 -0
- celldetective/gui/thresholds_gui.py +1300 -0
- celldetective/icons/logo-large.png +0 -0
- celldetective/icons/logo.png +0 -0
- celldetective/icons/signals_icon.png +0 -0
- celldetective/icons/splash-test.png +0 -0
- celldetective/icons/splash.png +0 -0
- celldetective/icons/splash0.png +0 -0
- celldetective/icons/survival2.png +0 -0
- celldetective/icons/vignette_signals2.png +0 -0
- celldetective/icons/vignette_signals2.svg +114 -0
- celldetective/io.py +2050 -0
- celldetective/links/zenodo.json +561 -0
- celldetective/measure.py +1258 -0
- celldetective/models/segmentation_effectors/blank +0 -0
- celldetective/models/segmentation_generic/blank +0 -0
- celldetective/models/segmentation_targets/blank +0 -0
- celldetective/models/signal_detection/blank +0 -0
- celldetective/models/tracking_configs/mcf7.json +68 -0
- celldetective/models/tracking_configs/ricm.json +203 -0
- celldetective/models/tracking_configs/ricm2.json +203 -0
- celldetective/neighborhood.py +717 -0
- celldetective/scripts/analyze_signals.py +51 -0
- celldetective/scripts/measure_cells.py +275 -0
- celldetective/scripts/segment_cells.py +212 -0
- celldetective/scripts/segment_cells_thresholds.py +140 -0
- celldetective/scripts/track_cells.py +206 -0
- celldetective/scripts/train_segmentation_model.py +246 -0
- celldetective/scripts/train_signal_model.py +49 -0
- celldetective/segmentation.py +712 -0
- celldetective/signals.py +2826 -0
- celldetective/tracking.py +974 -0
- celldetective/utils.py +1681 -0
- celldetective-1.0.2.dist-info/LICENSE +674 -0
- celldetective-1.0.2.dist-info/METADATA +192 -0
- celldetective-1.0.2.dist-info/RECORD +66 -0
- celldetective-1.0.2.dist-info/WHEEL +5 -0
- celldetective-1.0.2.dist-info/entry_points.txt +2 -0
- celldetective-1.0.2.dist-info/top_level.txt +1 -0
celldetective/filters.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from skimage.filters import difference_of_gaussians, threshold_otsu, threshold_local, threshold_niblack, threshold_sauvola
|
|
2
|
+
import scipy.ndimage as snd
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
def gauss_filter(img, sigma, *kwargs):
|
|
6
|
+
return snd.gaussian_filter(img.astype(float), sigma, *kwargs)
|
|
7
|
+
|
|
8
|
+
def median_filter(img, size, *kwargs):
|
|
9
|
+
size = int(size)
|
|
10
|
+
return snd.median_filter(img, size, *kwargs)
|
|
11
|
+
|
|
12
|
+
def maximum_filter(img, size, *kwargs):
|
|
13
|
+
return snd.maximum_filter(img.astype(float), size, *kwargs)
|
|
14
|
+
|
|
15
|
+
def minimum_filter(img, size, *kwargs):
|
|
16
|
+
return snd.minimum_filter(img.astype(float), size, *kwargs)
|
|
17
|
+
|
|
18
|
+
def percentile_filter(img, percentile, size, *kwargs):
|
|
19
|
+
return snd.percentile_filter(img.astype(float), percentile, size, *kwargs)
|
|
20
|
+
|
|
21
|
+
def subtract_filter(img, value, *kwargs):
|
|
22
|
+
return img.astype(float) - value
|
|
23
|
+
|
|
24
|
+
def abs_filter(img, *kwargs):
|
|
25
|
+
return np.abs(img)
|
|
26
|
+
|
|
27
|
+
def ln_filter(img, *kwargs):
|
|
28
|
+
|
|
29
|
+
img[np.where(img>0.)] = np.log(img[np.where(img>0.)])
|
|
30
|
+
img[np.where(img<=0.)] = 0.
|
|
31
|
+
|
|
32
|
+
return img
|
|
33
|
+
|
|
34
|
+
def variance_filter(img, size):
|
|
35
|
+
|
|
36
|
+
size = int(size)
|
|
37
|
+
img = img.astype(float)
|
|
38
|
+
win_mean = snd.uniform_filter(img, (size,size))
|
|
39
|
+
win_sqr_mean = snd.uniform_filter(img**2, (size,size))
|
|
40
|
+
img = win_sqr_mean - win_mean**2
|
|
41
|
+
|
|
42
|
+
return img
|
|
43
|
+
|
|
44
|
+
def std_filter(img, size):
|
|
45
|
+
|
|
46
|
+
size = int(size)
|
|
47
|
+
img = img.astype(float)
|
|
48
|
+
win_mean = snd.uniform_filter(img, (size,size))
|
|
49
|
+
win_sqr_mean = snd.uniform_filter(img**2, (size, size))
|
|
50
|
+
win_sqr_mean[win_sqr_mean!=win_sqr_mean] = 0.
|
|
51
|
+
win_sqr_mean[win_sqr_mean<=0.] = 0. # add this to prevent sqrt from breaking
|
|
52
|
+
img = np.sqrt(win_sqr_mean - win_mean**2)
|
|
53
|
+
|
|
54
|
+
return img
|
|
55
|
+
|
|
56
|
+
def laplace_filter(img, output=float, *kwargs):
|
|
57
|
+
return snd.laplace(img.astype(float), *kwargs)
|
|
58
|
+
|
|
59
|
+
def dog_filter(img, sigma_low, sigma_high, *kwargs):
|
|
60
|
+
return difference_of_gaussians(img.astype(float), sigma_low, sigma_high, *kwargs)
|
|
61
|
+
|
|
62
|
+
def otsu_filter(img, *kwargs):
|
|
63
|
+
thresh = threshold_otsu(img.astype(float))
|
|
64
|
+
binary = img >= thresh
|
|
65
|
+
return binary.astype(float)
|
|
66
|
+
|
|
67
|
+
def local_filter(img, *kwargs):
|
|
68
|
+
print(*kwargs)
|
|
69
|
+
thresh = threshold_local(img.astype(float), *kwargs)
|
|
70
|
+
binary = img >= thresh
|
|
71
|
+
return binary.astype(float)
|
|
72
|
+
|
|
73
|
+
def niblack_filter(img, *kwargs):
|
|
74
|
+
thresh = threshold_niblack(img, *kwargs)
|
|
75
|
+
binary = img >= thresh
|
|
76
|
+
return binary.astype(float)
|
|
77
|
+
|
|
78
|
+
def sauvola_filter(img, *kwargs):
|
|
79
|
+
thresh = threshold_sauvola(img, *kwargs)
|
|
80
|
+
binary = img >= thresh
|
|
81
|
+
return binary.astype(float)
|
|
82
|
+
|
|
83
|
+
def log_filter(img, sigma, *kwargs):
|
|
84
|
+
return snd.gaussian_laplace(img.astype(float), sigma, *kwargs)
|
|
85
|
+
|
|
86
|
+
def tophat_filter(img, size, connectivity=4, *kwargs):
|
|
87
|
+
structure = snd.generate_binary_structure(rank=2, connectivity=connectivity)
|
|
88
|
+
img = snd.white_tophat(img.astype(float), structure=structure, size=size, *kwargs)
|
|
89
|
+
return img
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from .styles import Styles
|
|
2
|
+
from .btrack_options import ConfigTracking
|
|
3
|
+
from .json_readers import ConfigEditor
|
|
4
|
+
from .tableUI import TableUI
|
|
5
|
+
from .measurement_options import ConfigMeasurements
|
|
6
|
+
from .neighborhood_options import ConfigNeighborhoods
|
|
7
|
+
from .classifier_widget import ClassifierWidget
|
|
8
|
+
from .survival_ui import ConfigSurvival
|
|
9
|
+
from .plot_signals_ui import ConfigSignalPlot
|
|
10
|
+
from .signal_annotator_options import ConfigSignalAnnotator
|
|
11
|
+
from .signal_annotator import SignalAnnotator
|
|
12
|
+
from .retrain_signal_model_options import ConfigSignalModelTraining
|
|
13
|
+
from .retrain_segmentation_model_options import ConfigSegmentationModelTraining
|
|
14
|
+
from .thresholds_gui import ThresholdConfigWizard
|
|
15
|
+
from .seg_model_loader import SegmentationModelLoader
|
|
16
|
+
from .process_block import ProcessPanel, NeighPanel
|
|
17
|
+
from .analyze_block import AnalysisPanel
|
|
18
|
+
from .control_panel import ControlPanel
|
|
19
|
+
from .configure_new_exp import ConfigNewExperiment
|
|
20
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel
|
|
2
|
+
from PyQt5.QtGui import QPixmap
|
|
3
|
+
from PyQt5.QtCore import Qt
|
|
4
|
+
from celldetective.utils import get_software_location
|
|
5
|
+
import celldetective
|
|
6
|
+
import os
|
|
7
|
+
from celldetective.gui.gui_utils import center_window
|
|
8
|
+
|
|
9
|
+
class AboutWidget(QWidget):
|
|
10
|
+
|
|
11
|
+
def __init__(self):
|
|
12
|
+
|
|
13
|
+
super().__init__()
|
|
14
|
+
self.setWindowTitle("About celldetective")
|
|
15
|
+
self.setMinimumWidth(300)
|
|
16
|
+
center_window(self)
|
|
17
|
+
logo = QPixmap(os.sep.join([get_software_location(),'celldetective','icons','logo.png']))
|
|
18
|
+
|
|
19
|
+
# Create the layout
|
|
20
|
+
layout = QVBoxLayout(self)
|
|
21
|
+
img_label = QLabel('')
|
|
22
|
+
img_label.setPixmap(logo)
|
|
23
|
+
layout.addWidget(img_label, alignment=Qt.AlignCenter)
|
|
24
|
+
|
|
25
|
+
self.soft_name = QLabel('celldetective')
|
|
26
|
+
self.soft_name.setStyleSheet("""font-weight: bold;
|
|
27
|
+
font-size: 18px;
|
|
28
|
+
""")
|
|
29
|
+
layout.addWidget(self.soft_name, alignment=Qt.AlignCenter)
|
|
30
|
+
|
|
31
|
+
self.version_lbl = QLabel(f"Version X.X.X <a href=\"https://github.com/remyeltorro/celldetective/releases\">(release notes)</a>")
|
|
32
|
+
self.version_lbl.setOpenExternalLinks(True)
|
|
33
|
+
layout.addWidget(self.version_lbl, alignment=Qt.AlignCenter)
|
|
34
|
+
|
|
35
|
+
self.lab_lbl = QLabel("Developed at Laboratoire Adhésion et Inflammation (LAI) INSERM U1067 CNRS UMR 7333")
|
|
36
|
+
self.lab_lbl.setWordWrap(True)
|
|
37
|
+
layout.addWidget(self.lab_lbl, alignment=Qt.AlignCenter)
|
|
38
|
+
|
|
39
|
+
self.centuri_mention = QLabel("The project leading to this publication has received funding from France 2030, the French Government program managed by the French National Research Agency (ANR-16-CONV-0001) and from Excellence Initiative of Aix-Marseille University - A*MIDEX')")
|
|
40
|
+
self.centuri_mention.setWordWrap(True)
|
|
41
|
+
layout.addWidget(self.centuri_mention, alignment=Qt.AlignCenter)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|