Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions synapse_net/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def _get_model_registry():
"vesicles_2d": "eb0b74f7000a0e6a25b626078e76a9452019f2d1ea6cf2033073656f4f055df1",
"vesicles_3d": "b329ec1f57f305099c984fbb3d7f6ae4b0ff51ec2fa0fa586df52dad6b84cf29",
"vesicles_cryo": "782f5a21c3cda82c4e4eaeccc754774d5aaed5929f8496eb018aad7daf91661b",
# Additional models that are only available in the CLI, not in the plugin model selection.
"vesicles_2d_maus": "01506895df6343fc33ffc9c9eb3f975bf42eb4eaaaf4848bac83b57f1b46e460",
"vesicles_3d_endbulb": "8582c7e3e5f16ef2bf34d6f9e34644862ca3c76835c9e7d44475c9dd7891d228",
"vesicles_3d_innerear": "924f0f7cfb648a3a6931c1d48d8b1fdc6c0c0d2cb3330fe2cae49d13e7c3b69d",
}
urls = {
"active_zone": "https://owncloud.gwdg.de/index.php/s/zvuY342CyQebPsX/download",
Expand All @@ -42,6 +46,10 @@ def _get_model_registry():
"vesicles_2d": "https://owncloud.gwdg.de/index.php/s/d72QIvdX6LsgXip/download",
"vesicles_3d": "https://owncloud.gwdg.de/index.php/s/A425mkAOSqePDhx/download",
"vesicles_cryo": "https://owncloud.gwdg.de/index.php/s/e2lVdxjCJuZkLJm/download",
# Additional models that are only available in the CLI, not in the plugin model selection.
"vesicles_2d_maus": "https://owncloud.gwdg.de/index.php/s/sZ8woLr0zs5zOpv/download",
"vesicles_3d_endbulb": "https://owncloud.gwdg.de/index.php/s/16tmnWrEDpYIMzU/download",
"vesicles_3d_innerear": "https://owncloud.gwdg.de/index.php/s/UFUCYivsCxrqISX/download",
}
cache_dir = get_cache_dir()
models = pooch.create(
Expand Down Expand Up @@ -108,6 +116,10 @@ def get_model_training_resolution(model_type: str) -> Dict[str, float]:
"vesicles_2d": {"x": 1.35, "y": 1.35},
"vesicles_3d": {"x": 1.35, "y": 1.35, "z": 1.35},
"vesicles_cryo": {"x": 1.35, "y": 1.35, "z": 0.88},
# TODO add the correct resolutions, these are the resolutions of the source models.
"vesicles_2d_maus": {"x": 1.35, "y": 1.35},
"vesicles_3d_endbulb": {"x": 1.35, "y": 1.35, "z": 1.35},
"vesicles_3d_innerear": {"x": 1.35, "y": 1.35, "z": 1.35},
}
return resolutions[model_type]

Expand Down
12 changes: 12 additions & 0 deletions synapse_net/napari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ contributions:
- id: synapse_net.sample_data_tem_tomo
python_name: synapse_net.sample_data:sample_data_tem_tomo
title: Load TEM Tomo sample data
- id: synapse_net.sample_data_tomo_small
python_name: synapse_net.sample_data:sample_data_tomo_small
title: Load small tomo sample data
- id: synapse_net.sample_data_mito_small
python_name: synapse_net.sample_data:sample_data_mito_small
title: Load TEM Tomo sample data

readers:
- command: synapse_net.file_reader
Expand Down Expand Up @@ -61,3 +67,9 @@ contributions:
- command: synapse_net.sample_data_tem_tomo
display_name: TEM Tomo Sample Data
key: synapse-net-tem-tomo
- command: synapse_net.sample_data_tomo_small
display_name: Small Tomo Sample Data
key: synapse-net-tomo-small
- command: synapse_net.sample_data_mito_small
display_name: Small Mito Sample Data
key: synapse-net-mito-small
12 changes: 12 additions & 0 deletions synapse_net/sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ def get_sample_data(name: str) -> str:
registry = {
"tem_2d.mrc": "3c6f9ff6d7673d9bf2fd46c09750c3c7dbb8fa1aa59dcdb3363b65cc774dcf28",
"tem_tomo.mrc": "fe862ce7c22000d4440e3aa717ca9920b42260f691e5b2ab64cd61c928693c99",
"tomo_small.mrc": "057b214777157682e220958e7ca5c90104eada67210a5589572134ac0d8d177f",
"mito_small.mrc": "643534ac080f13a4ba8c9f12f5ea59442cb6d1e7ae1a5aec5ea98b7ae9ab45cc",
}
urls = {
"tem_2d.mrc": "https://owncloud.gwdg.de/index.php/s/5sAQ0U4puAspcHg/download",
"tem_tomo.mrc": "https://owncloud.gwdg.de/index.php/s/FJDhDfbT4UxhtOn/download",
"tomo_small.mrc": "https://owncloud.gwdg.de/index.php/s/03NvEuIye08kkkL/download",
"mito_small.mrc": "https://owncloud.gwdg.de/index.php/s/TUhvVMrA7GE8sJv/download",
}
key = f"{name}.mrc"

Expand Down Expand Up @@ -55,6 +59,14 @@ def sample_data_tem_tomo():
return _sample_data("tem_tomo")


def sample_data_tomo_small():
return _sample_data("tomo_small")


def sample_data_mito_small():
return _sample_data("mito_small")


def download_data_from_zenodo(path: str, name: str):
"""Download data uploaded for the SynapseNet manuscript from zenodo.
Expand Down
7 changes: 6 additions & 1 deletion synapse_net/tools/segmentation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ def load_model_widget(self):
model_widget = QWidget()
title_label = QLabel("Select Model:")

models = ["- choose -"] + list(_get_model_registry().urls.keys())
# Exclude the models that are only offered through the CLI and not in the plugin.
model_list = set(_get_model_registry().urls.keys())
excluded_models = ["vesicles_2d_maus", "vesicles_3d_endbulb", "vesicles_3d_innerear"]
model_list = [name for name in model_list if name not in excluded_models]

models = ["- choose -"] + model_list
self.model_selector = QComboBox()
self.model_selector.addItems(models)
# Create a layout and add the title label and combo box
Expand Down