Skip to content

Commit

Permalink
Starting GUI linking
Browse files Browse the repository at this point in the history
  • Loading branch information
c-h-benedetti committed Nov 20, 2024
1 parent 5f1018d commit e4be06c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/microglia_analyzer/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ def segment_microglia_panel(self):
self.segment_microglia_group = QGroupBox("Segmentation")
layout = QVBoxLayout()

# Dropdown menu to choose a model
self.model_selector = QComboBox()
self.model_selector.addItem("---")
layout.addWidget(self.model_selector)

# Minimal area of a microglia
h_layout = QHBoxLayout()
self.minimal_area_label = QLabel("Min area (µm²):")
Expand Down Expand Up @@ -216,9 +211,6 @@ def select_image(self):
return
self.open_image(full_path)

def apply_calibration(self):
pass

def proba_threshold_update(self):
self.proba_value_label.setText(f"{self.probability_threshold_slider.value()}%")

Expand Down Expand Up @@ -285,7 +277,7 @@ def open_image(self, image_path):
self.viewer.layers[_IMAGE_LAYER_NAME].data = data
else:
self.viewer.add_image(data, name=_IMAGE_LAYER_NAME, colormap='green')
# self.mam.load_image(image_path)
self.mam.set_input_image(data)


def convert_to_optimal_unit(self, size, unit):
Expand Down Expand Up @@ -318,4 +310,4 @@ def set_calibration(self, size, unit):
layer.scale = (size, size)
self.pixel_size_label.setText(f"Pixel size: {size:.2f} {unit}")
self.viewer.scale_bar.visible = True
# self.mam.set_calibration(size, unit)
self.mam.set_calibration(size, unit)
10 changes: 8 additions & 2 deletions src/microglia_analyzer/models.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"µnet" : "https://dev.mri.cnrs.fr/attachments/download/3574/%C2%B5net.zip",
"µyolo": "https://dev.mri.cnrs.fr/attachments/download/3575/%C2%B5yolo.zip"
"µnet" : {
"url": "https://dev.mri.cnrs.fr/attachments/download/3574/%C2%B5net.zip",
"version": 208
},
"µyolo": {
"url": "https://dev.mri.cnrs.fr/attachments/download/3575/%C2%B5yolo.zip",
"version": 51
}
}
20 changes: 20 additions & 0 deletions src/microglia_analyzer/qt_workers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from qtpy.QtCore import QObject
from PyQt5.QtCore import pyqtSignal

class QtSegmentProtoplasts(QObject):

finished = pyqtSignal()
update = pyqtSignal(str, int, int)

def _probe_model(self, model):
pass

def __init__(self, pbr, mga):
super().__init__()
self.pbr = pbr
self.mga = mga

def run(self):
self.mga.find_traps()
self.mga.process_patches()
self.finished.emit()

0 comments on commit e4be06c

Please sign in to comment.