Skip to content

Commit ce8325a

Browse files
Add low-res sample data
1 parent d271463 commit ce8325a

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

flamingo_tools/model_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def get_device(device: Optional[Union[str, torch.device]] = None) -> Union[str,
5353
return device
5454

5555

56+
# FIXME: SGN-lowres seems to be the wrong model and doesn't work well on the sample data.
5657
def get_model_registry() -> None:
5758
"""Get the model registry for downloading pre-trained CochleaNet models.
5859
"""

flamingo_tools/napari.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ contributions:
1313
- id: cochlea_net.detect
1414
python_name: flamingo_tools.plugin.detection_widget:DetectionWidget
1515
title: Detection
16+
1617
# Add a measurement widget?
1718
# Add a labeling / classification widget?
1819

@@ -26,6 +27,12 @@ contributions:
2627
- id: cochlea_net.sample_data_ctbp2
2728
python_name: flamingo_tools.test_data:sample_data_ctbp2
2829
title: Example CtBP2 data
30+
- id: cochlea_net.sample_data_pv_lowres
31+
python_name: flamingo_tools.test_data:sample_data_pv_lowres
32+
title: Example PV lowres data
33+
- id: cochlea_net.sample_data_myo_lowres
34+
python_name: flamingo_tools.test_data:sample_data_myo_lowres
35+
title: Example MYO lowres data
2936

3037
widgets:
3138
- command: cochlea_net.segment
@@ -43,3 +50,9 @@ contributions:
4350
- command: cochlea_net.sample_data_ctbp2
4451
display_name: Sample Data CtBP2
4552
key: cochlea-net-ctbp2
53+
- command: cochlea_net.sample_data_pv_lowres
54+
display_name: Sample Data PV Lowres
55+
key: cochlea-net-pv-lowres
56+
- command: cochlea_net.sample_data_myo_lowres
57+
display_name: Sample Data MYO Lowres
58+
key: cochlea-net-myo-lowres

flamingo_tools/plugin/segmentation_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def load_model_widget(self):
6565
model_list = list(get_model_registry().urls.keys())
6666

6767
# Exclude the detection models.
68-
segmentation_models = ["SGN", "IHC"]
68+
segmentation_models = ["SGN", "IHC", "SGN-lowres", "IHC-lowres"]
6969
model_list = [name for name in model_list if name in segmentation_models]
7070

7171
models = ["- choose -"] + model_list

flamingo_tools/test_data.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ def _sample_registry():
100100
"PV": "https://owncloud.gwdg.de/index.php/s/JVZCOpkILT70sdv/download",
101101
"VGlut3": "https://owncloud.gwdg.de/index.php/s/LvGXh0xQR9IKvNk/download",
102102
"CTBP2": "https://owncloud.gwdg.de/index.php/s/qaffCaF1sGpqlT3/download",
103-
"PV-lowres": "",
104-
"IHC-lowres": "",
103+
"PV-lowres": "https://owncloud.gwdg.de/index.php/s/9BjuMIo9ulrqKVp/download",
104+
"MYO-lowres": "https://owncloud.gwdg.de/index.php/s/aKJrQs1zkBtFBI9/download",
105105
}
106106
registry = {
107107
"PV": "fbf50cc9119f2dd2bd4dac7d76b746b7d42cab33b94b21f8df304478dd51e632",
108108
"VGlut3": "6a3af6ffce3d06588ffdc73df356ac64b83b53aaf6aabeabd49ef6d11d927e20",
109109
"CTBP2": "8dcd5f1ebb35194f328788594e275f2452de0e28c85073578dac7100d83c45fc",
110-
"PV-lowres": "",
111-
"IHC-lowres": "",
110+
"PV-lowres": "325684d5a74eed356ac7e0d7720a727a58862f6d26c2884937eae7013f51bdc9",
111+
"MYO-lowres": "386f0b66a1716268b6e80d694e0a5170fd06f5b6f7ad1698ea4a0bb0464a4a5c",
112112
}
113113
cache_dir = get_cache_dir()
114114
data_registry = pooch.create(
@@ -148,8 +148,8 @@ def sample_data_pv_lowres():
148148
return [(data, add_image_kwargs)]
149149

150150

151-
def sample_data_ihc_lowres():
152-
data_path = _sample_registry().fetch("IHC-lowres")
151+
def sample_data_myo_lowres():
152+
data_path = _sample_registry().fetch("MYO-lowres")
153153
data = imageio.imread(data_path, extension=".tif")
154-
add_image_kwargs = {"name": "IHC-lowres", "colormap": "gray"}
154+
add_image_kwargs = {"name": "MYO-lowres", "colormap": "gray"}
155155
return [(data, add_image_kwargs)]

0 commit comments

Comments
 (0)