1+ """
2+ Sample microscopy data.
3+ """
4+
15import os
26from pathlib import Path
7+ from typing import Union
38
49import pooch
510
611
7- def fetch_image_series_example_data (save_directory ) :
12+ def fetch_image_series_example_data (save_directory : Union [ str , os . PathLike ]) -> Union [ str , os . PathLike ] :
813 """Download the sample images for the image series annotator.
14+
15+ Args:
16+ save_directory: Root folder to save the downloaded data.
17+ Returns:
18+ The folder that contains the downloaded data.
919 """
1020 save_directory = Path (save_directory )
1121 os .makedirs (save_directory , exist_ok = True )
@@ -26,11 +36,16 @@ def fetch_image_series_example_data(save_directory):
2636 return data_folder
2737
2838
29- def fetch_wholeslide_example_data (save_directory ) :
39+ def fetch_wholeslide_example_data (save_directory : Union [ str , os . PathLike ]) -> Union [ str , os . PathLike ] :
3040 """Download the sample data for the 2d annotator.
3141
3242 This downloads part of a whole-slide image from the NeurIPS Cell Segmentation Challenge.
3343 See https://neurips22-cellseg.grand-challenge.org/ for details on the data.
44+
45+ Args:
46+ save_directory: Root folder to save the downloaded data.
47+ Returns:
48+ The path of the downloaded image.
3449 """
3550 save_directory = Path (save_directory )
3651 os .makedirs (save_directory , exist_ok = True )
@@ -46,11 +61,16 @@ def fetch_wholeslide_example_data(save_directory):
4661 return os .path .join (save_directory , fname )
4762
4863
49- def fetch_livecell_example_data (save_directory ) :
64+ def fetch_livecell_example_data (save_directory : Union [ str , os . PathLike ]) -> Union [ str , os . PathLike ] :
5065 """Download the sample data for the 2d annotator.
5166
5267 This downloads a single image from the LiveCELL dataset.
5368 See https://doi.org/10.1038/s41592-021-01249-6 for details on the data.
69+
70+ Args:
71+ save_directory: Root folder to save the downloaded data.
72+ Returns:
73+ The path of the downloaded image.
5474 """
5575 save_directory = Path (save_directory )
5676 os .makedirs (save_directory , exist_ok = True )
@@ -66,10 +86,15 @@ def fetch_livecell_example_data(save_directory):
6686 return os .path .join (save_directory , fname )
6787
6888
69- def fetch_hela_2d_example_data (save_directory ) :
89+ def fetch_hela_2d_example_data (save_directory : Union [ str , os . PathLike ]) -> Union [ str , os . PathLike ] :
7090 """Download the sample data for the 2d annotator.
7191
7292 This downloads a single image from the HeLa CTC dataset.
93+
94+ Args:
95+ save_directory: Root folder to save the downloaded data.
96+ Returns:
97+ The path of the downloaded image.
7398 """
7499 save_directory = Path (save_directory )
75100 os .makedirs (save_directory , exist_ok = True )
@@ -85,11 +110,16 @@ def fetch_hela_2d_example_data(save_directory):
85110 return os .path .join (save_directory , fname )
86111
87112
88- def fetch_3d_example_data (save_directory ) :
113+ def fetch_3d_example_data (save_directory : Union [ str , os . PathLike ]) -> Union [ str , os . PathLike ] :
89114 """Download the sample data for the 3d annotator.
90115
91116 This downloads the Lucchi++ datasets from https://casser.io/connectomics/.
92117 It is a dataset for mitochondria segmentation in EM.
118+
119+ Args:
120+ save_directory: Root folder to save the downloaded data.
121+ Returns:
122+ The folder that contains the downloaded data.
93123 """
94124 save_directory = Path (save_directory )
95125 os .makedirs (save_directory , exist_ok = True )
@@ -109,7 +139,7 @@ def fetch_3d_example_data(save_directory):
109139 return str (lucchi_dir )
110140
111141
112- def fetch_tracking_example_data (save_directory ) :
142+ def fetch_tracking_example_data (save_directory : Union [ str , os . PathLike ]) -> Union [ str , os . PathLike ] :
113143 """Download the sample data for the tracking annotator.
114144
115145 This data is the cell tracking challenge dataset DIC-C2DH-HeLa.
@@ -118,6 +148,11 @@ def fetch_tracking_example_data(save_directory):
118148 Dr. G. van Cappellen. Erasmus Medical Center, Rotterdam, The Netherlands
119149 Training dataset: http://data.celltrackingchallenge.net/training-datasets/DIC-C2DH-HeLa.zip (37 MB)
120150 Challenge dataset: http://data.celltrackingchallenge.net/challenge-datasets/DIC-C2DH-HeLa.zip (41 MB)
151+
152+ Args:
153+ save_directory: Root folder to save the downloaded data.
154+ Returns:
155+ The folder that contains the downloaded data.
121156 """
122157 save_directory = Path (save_directory )
123158 os .makedirs (save_directory , exist_ok = True )
0 commit comments