diff --git a/synapse_net/inference/inference.py b/synapse_net/inference/inference.py index 9236df69..32e3f700 100644 --- a/synapse_net/inference/inference.py +++ b/synapse_net/inference/inference.py @@ -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", @@ -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( @@ -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] diff --git a/synapse_net/napari.yaml b/synapse_net/napari.yaml index 9b10f7f8..2bfe1f6d 100644 --- a/synapse_net/napari.yaml +++ b/synapse_net/napari.yaml @@ -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 @@ -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 diff --git a/synapse_net/sample_data.py b/synapse_net/sample_data.py index 7eb53add..69f4fcc3 100644 --- a/synapse_net/sample_data.py +++ b/synapse_net/sample_data.py @@ -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" @@ -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. diff --git a/synapse_net/tools/segmentation_widget.py b/synapse_net/tools/segmentation_widget.py index 9f4a3a18..87b47571 100644 --- a/synapse_net/tools/segmentation_widget.py +++ b/synapse_net/tools/segmentation_widget.py @@ -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