bbbc-datasets 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. bbbc_datasets/__init__.py +0 -0
  2. bbbc_datasets/config.py +15 -0
  3. bbbc_datasets/dataset_manager.py +123 -0
  4. bbbc_datasets/datasets/__init__.py +0 -0
  5. bbbc_datasets/datasets/base_dataset.py +230 -0
  6. bbbc_datasets/datasets/bbbc003.py +40 -0
  7. bbbc_datasets/datasets/bbbc004.py +60 -0
  8. bbbc_datasets/datasets/bbbc005.py +40 -0
  9. bbbc_datasets/datasets/bbbc006.py +54 -0
  10. bbbc_datasets/datasets/bbbc008.py +35 -0
  11. bbbc_datasets/datasets/bbbc010.py +39 -0
  12. bbbc_datasets/datasets/bbbc024.py +70 -0
  13. bbbc_datasets/datasets/bbbc027.py +64 -0
  14. bbbc_datasets/datasets/bbbc028.py +34 -0
  15. bbbc_datasets/datasets/bbbc029.py +35 -0
  16. bbbc_datasets/datasets/bbbc032.py +44 -0
  17. bbbc_datasets/datasets/bbbc033.py +36 -0
  18. bbbc_datasets/datasets/bbbc034.py +52 -0
  19. bbbc_datasets/datasets/bbbc035.py +42 -0
  20. bbbc_datasets/datasets/bbbc038.py +88 -0
  21. bbbc_datasets/datasets/bbbc039.py +41 -0
  22. bbbc_datasets/datasets/bbbc046.py +100 -0
  23. bbbc_datasets/datasets/bbbc050.py +47 -0
  24. bbbc_datasets/datasets/cellpose.py +22 -0
  25. bbbc_datasets/datasets/evican.py +0 -0
  26. bbbc_datasets/datasets/isbi15.py +0 -0
  27. bbbc_datasets/datasets/livecell.py +25 -0
  28. bbbc_datasets/datasets/sartorius.py +23 -0
  29. bbbc_datasets/utils/__init__.py +0 -0
  30. bbbc_datasets/utils/downloader.py +33 -0
  31. bbbc_datasets/utils/file_handler.py +0 -0
  32. bbbc_datasets/utils/file_io.py +33 -0
  33. bbbc_datasets-0.1.0.dist-info/LICENSE +21 -0
  34. bbbc_datasets-0.1.0.dist-info/METADATA +175 -0
  35. bbbc_datasets-0.1.0.dist-info/RECORD +40 -0
  36. bbbc_datasets-0.1.0.dist-info/WHEEL +5 -0
  37. bbbc_datasets-0.1.0.dist-info/top_level.txt +2 -0
  38. tests/__init__.py +40 -0
  39. tests/test_dataset_loading.py +43 -0
  40. tests/test_download.py +38 -0
File without changes
@@ -0,0 +1,15 @@
1
+ BBBC_DATASETS = {
2
+ "BBBC001": {
3
+ "image_paths": [
4
+ "https://bbbc.broadinstitute.org/BBBC001/images_1",
5
+ "https://bbbc.broadinstitute.org/BBBC001/images_2",
6
+ ],
7
+ "label_path": "https://bbbc.broadinstitute.org/BBBC001/masks",
8
+ "local_path": "data/BBBC001",
9
+ },
10
+ "BBBC002": {
11
+ "image_paths": ["https://bbbc.broadinstitute.org/BBBC002/images"],
12
+ "label_path": None, # No segmentation ground truth
13
+ "local_path": "data/BBBC002",
14
+ },
15
+ }
@@ -0,0 +1,123 @@
1
+ import cv2
2
+ import numpy as np
3
+ import tifffile as tiff
4
+ import torch
5
+ from torch.utils.data import Dataset
6
+
7
+ from tests import DATASETS # Import shared dataset list
8
+
9
+
10
+ class BBBCDataset(Dataset):
11
+ """
12
+ PyTorch-compatible dataset for loading BBBC datasets with full 3D support.
13
+
14
+ - Supports both 2D and 3D images.
15
+ - Optionally applies transformations (PyTorch `torchvision.transforms`).
16
+ - Returns (image, label) pairs where available.
17
+
18
+ Args:
19
+ dataset_cls: The BBBC dataset class to load.
20
+ transform (callable, optional): Optional transform to apply to images.
21
+ target_transform (callable, optional): Optional transform for labels.
22
+ """
23
+
24
+ def __init__(self, dataset_cls, transform=None, target_transform=None):
25
+ self.dataset = dataset_cls()
26
+ self.image_paths = self.dataset.get_image_paths()
27
+ self.label_path = self.dataset.get_label_paths()
28
+
29
+ if not self.image_paths:
30
+ raise RuntimeError(f"No images found in {dataset_cls.__name__}")
31
+
32
+ self.transform = transform
33
+ self.target_transform = target_transform
34
+
35
+ def __len__(self):
36
+ return len(self.image_paths)
37
+
38
+ def __getitem__(self, idx):
39
+ image_path = self.image_paths[idx]
40
+ image = self.load_image(image_path)
41
+
42
+ label = None
43
+ if self.label_path:
44
+ label = self.load_image(self.label_path)
45
+
46
+ # Apply transforms if provided
47
+ if self.transform:
48
+ image = self.transform(image)
49
+ if self.target_transform and label is not None:
50
+ label = self.target_transform(label)
51
+
52
+ return image, label
53
+
54
+ def load_image(self, image_path):
55
+ """
56
+ Loads an image (2D or full 3D) and converts it to a PyTorch tensor.
57
+ """
58
+ if image_path.endswith((".tif", ".tiff")):
59
+ img = tiff.imread(image_path) # Load 3D TIFF or 2D image
60
+ else:
61
+ img = cv2.imread(image_path, cv2.IMREAD_UNCHANGED) # Load 2D image
62
+
63
+ if img is None:
64
+ raise ValueError(f"Error: Could not read image {image_path}")
65
+
66
+ # Normalize grayscale images
67
+ img = (img - np.min(img)) / (np.max(img) - np.min(img) + 1e-8)
68
+
69
+ # Convert to tensor
70
+ if len(img.shape) == 2: # 2D grayscale image
71
+ img = torch.tensor(img, dtype=torch.float32).unsqueeze(0) # (C, H, W)
72
+ elif len(img.shape) == 3: # 3D volume (Z, H, W)
73
+ img = torch.tensor(img, dtype=torch.float32).unsqueeze(0) # (C, Z, H, W)
74
+
75
+ return img
76
+
77
+
78
+ class DatasetManager:
79
+ """
80
+ Manages all BBBC datasets and provides utilities.
81
+
82
+ - Lists available datasets.
83
+ - Loads datasets dynamically as PyTorch Datasets.
84
+ - Displays dataset information.
85
+ """
86
+
87
+ @staticmethod
88
+ def list_datasets():
89
+ """Prints a summary of available BBBC datasets."""
90
+ print("\n📂 Available BBBC Datasets:")
91
+ for dataset_cls in DATASETS:
92
+ dataset = dataset_cls()
93
+ print(f"- {dataset_cls.__name__}: {dataset.dataset_name}")
94
+
95
+ @staticmethod
96
+ def get_dataset(name, transform=None, target_transform=None):
97
+ """
98
+ Loads a dataset by name.
99
+
100
+ Args:
101
+ name (str): The dataset class name (e.g., "BBBC003").
102
+ transform: Optional image transformations.
103
+ target_transform: Optional label transformations.
104
+
105
+ Returns:
106
+ BBBCDataset instance.
107
+ """
108
+ for dataset_cls in DATASETS:
109
+ if dataset_cls.__name__ == name:
110
+ return BBBCDataset(dataset_cls, transform, target_transform)
111
+
112
+ raise ValueError(
113
+ f"Dataset {name} not found. Use DatasetManager.list_datasets() to see available datasets."
114
+ )
115
+
116
+
117
+ if __name__ == "__main__":
118
+ # Example Usage
119
+ DatasetManager.list_datasets()
120
+
121
+ # Load a dataset
122
+ dataset = DatasetManager.get_dataset("BBBC003")
123
+ print(f"\nLoaded {len(dataset)} samples from BBBC003")
File without changes
@@ -0,0 +1,230 @@
1
+ import os
2
+ import zipfile
3
+ import difflib
4
+
5
+ import pandas as pd
6
+ import numpy as np
7
+ import requests
8
+ from tqdm import tqdm
9
+
10
+ from bbbc_datasets.utils.file_io import load_image
11
+
12
+
13
+ class BaseBBBCDataset:
14
+ """
15
+ Base class for BBBC datasets, handling downloading, extraction, and file management.
16
+
17
+ - Automatically downloads dataset files if they are not available locally.
18
+ - Stores datasets in a shared system-wide folder (`/opt/bbbc_datasets/` or `~/.bbbc_datasets/`).
19
+ - Supports structured access to images, labels, and metadata.
20
+ """
21
+
22
+ # Define a shared system-wide storage location
23
+ GLOBAL_STORAGE_PATH = os.path.expanduser("~/.bbbc_datasets/")
24
+ IMAGE_SUBDIR = "images"
25
+ LABEL_SUBDIR = "labels"
26
+
27
+ IMAGE_FILTER = [".png", ".jpg", ".jpeg", ".tif", ".tiff", ".ics"]
28
+
29
+ local_path = None
30
+ label_path = None
31
+ image_paths = None
32
+ is_3d = False
33
+
34
+ def __init__(self, dataset_name):
35
+ """
36
+ Initialize the dataset with name and file paths.
37
+
38
+ :param dataset_name: The name of the dataset (e.g., "BBBC003").
39
+ :param dataset_info: Dictionary containing paths to images, label masks, and metadata.
40
+ """
41
+ self.ground_truth = None
42
+ self.dataset_name = dataset_name
43
+
44
+ if not self.local_path:
45
+ raise ValueError("local_path not defined")
46
+
47
+ # Ensure the dataset directory exists in the shared location
48
+ os.makedirs(self.local_path, exist_ok=True)
49
+
50
+ # Download missing files
51
+ self._download_files()
52
+
53
+ if self.label_path and isinstance(self.label_path, str):
54
+ local_file, unzip_folder = self.get_download_folder(
55
+ self.label_path, "label_path"
56
+ )
57
+ if self.label_path.endswith(".csv"):
58
+ self.ground_truth = local_file
59
+ elif self.label_path.endswith(".tif"):
60
+ self.ground_truth = local_file
61
+
62
+ def _download_files(self):
63
+ """
64
+ Checks for missing dataset files and downloads them if necessary.
65
+ """
66
+
67
+ if isinstance(self.image_paths, list):
68
+ for url in self.image_paths:
69
+ self._download_and_extract("image", url)
70
+ elif self.image_paths:
71
+ self._download_and_extract("image", self.image_paths)
72
+
73
+ if isinstance(self.label_path, list):
74
+ for url in self.label_path:
75
+ self._download_and_extract("label", url)
76
+ elif self.label_path:
77
+ self._download_and_extract("label", self.label_path)
78
+
79
+ def _download_and_extract(self, key, url):
80
+ """
81
+ Downloads and extracts a dataset file if it is missing.
82
+ """
83
+ if not url.startswith("http"):
84
+ return # Skip invalid URLs
85
+
86
+ local_file, unzip_folder = self.get_download_folder(url, key)
87
+
88
+ if not os.path.exists(local_file):
89
+ print(f"Downloading {local_file}...")
90
+ response = requests.get(url, stream=True)
91
+ if response.status_code == 200:
92
+ total_size = int(response.headers.get("content-length", 0))
93
+ with open(local_file, "wb") as f, tqdm(
94
+ desc=local_file,
95
+ total=total_size,
96
+ unit="B",
97
+ unit_scale=True,
98
+ unit_divisor=1024,
99
+ ) as bar:
100
+ for chunk in response.iter_content(chunk_size=1024):
101
+ if chunk:
102
+ f.write(chunk)
103
+ bar.update(len(chunk))
104
+ else:
105
+ raise FileNotFoundError(f"Failed to download {url}")
106
+
107
+ if os.path.exists(local_file) and not os.path.exists(unzip_folder):
108
+ # Extract if it's a zip file
109
+ if local_file.endswith(".zip"):
110
+ self._extract_zip(local_file, unzip_folder)
111
+
112
+ def get_download_folder(self, url, key):
113
+ local_file = os.path.join(self.local_path, os.path.basename(url))
114
+ folder_name = self.IMAGE_SUBDIR if "image" in key else self.LABEL_SUBDIR
115
+ unzip_folder = os.path.join(self.local_path, folder_name)
116
+ return local_file, unzip_folder
117
+
118
+ def _extract_zip(self, zip_path, extract_to=None):
119
+ """
120
+ Extracts a zip file to the specified directory or the dataset directory.
121
+ """
122
+ target_path = extract_to if extract_to else self.local_path
123
+ print(f"Extracting {zip_path} to {target_path}...")
124
+ with zipfile.ZipFile(zip_path, "r") as zip_ref:
125
+ zip_ref.extractall(target_path)
126
+
127
+ def _get_paths(self, subdir, recursive=True):
128
+ """
129
+ Returns the list of image file paths.
130
+ """
131
+
132
+ dir_path = os.path.join(self.local_path, subdir)
133
+ files = self._list_files(dir_path=dir_path)
134
+
135
+ # recursively search for images in the list of files
136
+ if recursive:
137
+ for file in files:
138
+ if os.path.isdir(file):
139
+ files.extend(self._list_files(dir_path=file))
140
+
141
+ images = [f for f in files if f.lower().endswith(tuple(self.IMAGE_FILTER))]
142
+ return images
143
+
144
+ def get_image_paths(self):
145
+ """
146
+ Returns the list of image file paths.
147
+ """
148
+ images = self._get_paths(self.IMAGE_SUBDIR)
149
+ return images
150
+
151
+ def get_label(self, image_path):
152
+ """
153
+ Returns the label mask for a given image path.
154
+ """
155
+ if self.ground_truth:
156
+ if self.ground_truth.endswith(".tif"):
157
+ return load_image(self.ground_truth)
158
+ elif self.ground_truth.endswith(".csv"):
159
+ gt_all = pd.read_csv(self.ground_truth)
160
+ image_id = os.path.basename(image_path).split(".")[0]
161
+ gt_image = gt_all[gt_all["ImageId"] == image_id]
162
+ pixels = gt_image["EncodedPixels"]
163
+
164
+ image = load_image(image_path)
165
+ labels = np.zeros_like(image)
166
+
167
+ for pxls in pixels:
168
+ if isinstance(pxls, str):
169
+ pxls = pxls.split(" ")
170
+ pxls = [int(p) for p in pxls]
171
+ for i in range(0, len(pxls), 2):
172
+ labels[pxls[i] : pxls[i + 1]] = 1
173
+ return labels
174
+ else:
175
+ raise NotImplementedError("Label type not supported.")
176
+
177
+ # Find the corresponding label mask
178
+ label_paths = self.get_label_paths()
179
+
180
+ if not label_paths:
181
+ return None
182
+
183
+ # find the label path the most similar to the image path
184
+ label_path = difflib.get_close_matches(
185
+ image_path, label_paths, n=1, cutoff=0.25
186
+ )
187
+
188
+ if not label_path:
189
+ raise FileNotFoundError(f"Label mask not found for {image_path}")
190
+ else:
191
+ label_path = label_path[0]
192
+
193
+ if os.path.exists(label_path):
194
+ return load_image(label_path)
195
+ else:
196
+ raise FileNotFoundError(f"Label mask not found for {image_path}")
197
+
198
+ def get_label_paths(self):
199
+ """
200
+ Returns the label mask file path (if available).
201
+ """
202
+ images = self._get_paths(self.LABEL_SUBDIR)
203
+ return images
204
+
205
+ def get_metadata_paths(self):
206
+ """
207
+ Returns the metadata file paths (if available).
208
+ """
209
+ dir_path = os.path.join(self.local_path, "metadata")
210
+ return self._list_files(dir_path=dir_path)
211
+
212
+ def _list_files(self, dir_path):
213
+ """
214
+ Returns a list of files in a specific dataset subdirectory.
215
+ """
216
+
217
+ if os.path.exists(dir_path):
218
+ return [os.path.join(dir_path, f) for f in os.listdir(dir_path)]
219
+ return []
220
+
221
+ @staticmethod
222
+ def validate_url(url):
223
+ """
224
+ Checks if a given URL is reachable.
225
+ """
226
+ try:
227
+ response = requests.head(url, allow_redirects=True, timeout=5)
228
+ return response.status_code == 200
229
+ except requests.RequestException:
230
+ return False
@@ -0,0 +1,40 @@
1
+ import os
2
+
3
+ from bbbc_datasets.datasets.base_dataset import BaseBBBCDataset
4
+
5
+
6
+ class BBBC003(BaseBBBCDataset):
7
+ """
8
+ BBBC003 Dataset: DIC microscopy images of mouse embryos for segmentation analysis.
9
+
10
+ - **Biological Application:**
11
+ Fluorescence microscopy cannot be used for embryo viability assessment in in vitro fertilization.
12
+ Instead, DIC imaging is used, though automatic segmentation remains a challenge due to shading effects.
13
+
14
+ - **Images:**
15
+ 15 images of size 640x480 pixels, acquired using a Nikon Eclipse TE200 microscope
16
+ with a 20x, 0.45 NA objective lens.
17
+
18
+ - **Segmentations:**
19
+ Ground truth masks available for foreground segmentation.
20
+
21
+ - **Additional Data:**
22
+ Cell count data for each image is provided.
23
+
24
+ - **Source:** https://bbbc.broadinstitute.org/BBBC003
25
+ """
26
+
27
+ def __init__(self):
28
+ self.local_path = os.path.join(self.GLOBAL_STORAGE_PATH, "BBBC003")
29
+ self.image_paths = [
30
+ "https://data.broadinstitute.org/bbbc/BBBC003/BBBC003_v1_images.zip"
31
+ ]
32
+ self.label_path = (
33
+ "https://data.broadinstitute.org/bbbc/BBBC003/BBBC003_v1_foreground.zip"
34
+ )
35
+ self.metadata_paths = [
36
+ "https://data.broadinstitute.org/bbbc/BBBC003/BBBC003_v1_counts.txt"
37
+ ]
38
+ self.is_3d = False
39
+
40
+ super().__init__("BBBC003")
@@ -0,0 +1,60 @@
1
+ import os
2
+
3
+ from bbbc_datasets.datasets.base_dataset import BaseBBBCDataset
4
+
5
+
6
+ class BBBC004(BaseBBBCDataset):
7
+ """
8
+ BBBC004 Dataset: Synthetic fluorescence microscopy images of nuclei with varying clustering probabilities.
9
+
10
+ - **Biological Application:**
11
+ This dataset is used to evaluate the performance of nuclei segmentation and counting algorithms
12
+ under different levels of nuclear clustering.
13
+
14
+ - **Images:**
15
+ Five subsets of 20 images each, with overlap probabilities: [0, 0.15, 0.3, 0.45, 0.6].
16
+
17
+ - **Segmentations:**
18
+ Ground truth binary segmentation masks for foreground detection.
19
+
20
+ - **Ground Truth:**
21
+ Each image contains exactly 300 objects.
22
+
23
+ - **Source:** https://bbbc.broadinstitute.org/BBBC004
24
+ """
25
+
26
+ BASE_URL = "https://data.broadinstitute.org/bbbc/BBBC004"
27
+
28
+ OVERLAP_PROBABILITIES = {
29
+ 0.00: "000",
30
+ 0.15: "015",
31
+ 0.30: "030",
32
+ 0.45: "045",
33
+ 0.60: "060",
34
+ }
35
+
36
+ def __init__(self, overlap_probability=0.00):
37
+ """
38
+ Initialize the dataset with a specific overlap probability.
39
+
40
+ :param overlap_probability: The clustering probability of nuclei (0, 0.15, 0.3, 0.45, 0.6)
41
+ """
42
+ if overlap_probability not in self.OVERLAP_PROBABILITIES:
43
+ raise ValueError(
44
+ f"Invalid overlap probability: {overlap_probability}. Choose from {list(self.OVERLAP_PROBABILITIES.keys())}"
45
+ )
46
+
47
+ self.prob_str = self.OVERLAP_PROBABILITIES[overlap_probability]
48
+ self.local_path = os.path.join(
49
+ self.GLOBAL_STORAGE_PATH, "BBBC004", f"prob_{self.prob_str}"
50
+ )
51
+ self.image_paths = [
52
+ os.path.join(self.BASE_URL, f"BBBC004_v1_{self.prob_str}_images.zip")
53
+ ]
54
+ self.label_path = os.path.join(
55
+ self.BASE_URL, f"BBBC004_v1_{self.prob_str}_foreground.zip"
56
+ )
57
+ self.metadata_paths = None
58
+ self.is_3d = False
59
+
60
+ super().__init__(f"BBBC004_{self.prob_str}")
@@ -0,0 +1,40 @@
1
+ import os
2
+
3
+ from bbbc_datasets.datasets.base_dataset import BaseBBBCDataset
4
+
5
+
6
+ class BBBC005(BaseBBBCDataset):
7
+ """
8
+ BBBC005 Dataset: Simulated fluorescence microscopy images with varying focus blur.
9
+
10
+ - **Biological Application:**
11
+ Evaluates the impact of focus blur on foreground/background segmentation in high-content screening.
12
+
13
+ - **Images:**
14
+ - 19,200 images with different levels of focus blur.
15
+ - Simulated using the SIMCEP platform.
16
+ - Plate layout nomenclature:
17
+ - **Row** = Blur level
18
+ - **Column** = Cell count.
19
+
20
+ - **Segmentations:**
21
+ - Ground truth masks available for fully in-focus images (**F1** files).
22
+ - Stored as binary masks (white = foreground, black = background).
23
+
24
+ - **Metadata:**
25
+ - Cell counts and blur levels are encoded in image filenames.
26
+ - Additional metadata is stored in `BBBC005_results_bray.csv`.
27
+
28
+ - **Source:** https://bbbc.broadinstitute.org/BBBC005
29
+ """
30
+
31
+ BASE_URL = "https://data.broadinstitute.org/bbbc/BBBC005"
32
+
33
+ def __init__(self):
34
+ self.local_path = os.path.join(self.GLOBAL_STORAGE_PATH, "BBBC005")
35
+ self.image_paths = [os.path.join(self.BASE_URL, "BBBC005_v1_images.zip")]
36
+ self.label_path = os.path.join(self.BASE_URL, "BBBC005_v1_ground_truth.zip")
37
+ self.metadata_paths = [os.path.join(self.BASE_URL, "BBBC005_results_bray.csv")]
38
+ self.is_3d = False
39
+
40
+ super().__init__("BBBC005")
@@ -0,0 +1,54 @@
1
+ import os
2
+
3
+ from bbbc_datasets.datasets.base_dataset import BaseBBBCDataset
4
+
5
+
6
+ class BBBC006(BaseBBBCDataset):
7
+ """
8
+ BBBC006 Dataset: Z-stack fluorescence microscopy images of human U2OS cells.
9
+
10
+ - **Biological Application:**
11
+ Evaluates the effect of focus variations on foreground segmentation in high-content screening.
12
+
13
+ - **Images:**
14
+ - 32 z-stack focal planes per field of view.
15
+ - Two fluorescence markers:
16
+ - Hoechst (w1): Stains nuclei.
17
+ - Phalloidin (w2): Stains cell bodies.
18
+
19
+ - **Segmentations:**
20
+ - Ground truth segmentation available for in-focus images (z = 11 to z = 23).
21
+ - Masks are 8-bit grayscale PNGs (each segmented nucleus has a unique integer label).
22
+
23
+ - **Metadata:**
24
+ - Nucleus count data and field of view information.
25
+
26
+ - **Source:** https://bbbc.broadinstitute.org/BBBC006
27
+ """
28
+
29
+ BASE_URL = "https://data.broadinstitute.org/bbbc/BBBC006"
30
+
31
+ def __init__(self, z_plane=16):
32
+ """
33
+ Initialize the dataset for a specific z-plane.
34
+
35
+ :param z_plane: The z-stack focal plane to download (0-32, default = 16 for optimal focus).
36
+ """
37
+ if not (0 <= z_plane <= 32):
38
+ raise ValueError(f"Invalid z-plane: {z_plane}. Choose between 0 and 32.")
39
+
40
+ self.z_plane = z_plane
41
+ self.local_path = os.path.join(
42
+ self.GLOBAL_STORAGE_PATH, "BBBC006", f"z_{z_plane:02}"
43
+ )
44
+ self.image_paths = [
45
+ os.path.join(self.BASE_URL, f"BBBC006_v1_images_z_{z_plane:02}.zip")
46
+ ]
47
+ self.label_path = os.path.join(self.BASE_URL, "BBBC006_v1_labels.zip")
48
+ self.metadata_paths = [
49
+ os.path.join(self.BASE_URL, "BBBC006_v1_counts.csv"),
50
+ os.path.join(self.BASE_URL, "BBBC006_results_bray.csv"),
51
+ ]
52
+ self.is_3d = False
53
+
54
+ super().__init__(f"BBBC006_z_{z_plane:02}")
@@ -0,0 +1,35 @@
1
+ import os
2
+
3
+ from bbbc_datasets.datasets.base_dataset import BaseBBBCDataset
4
+
5
+
6
+ class BBBC008(BaseBBBCDataset):
7
+ """
8
+ BBBC008 Dataset: Fluorescence microscopy images of human HT29 colon cancer cells.
9
+
10
+ - **Biological Application:**
11
+ This dataset is used for segmentation and cell counting of HT29 colon cancer cells.
12
+
13
+ - **Images:**
14
+ - 12 images, each containing three fluorescence channels:
15
+ - Hoechst (DNA, Channel 1).
16
+ - Phalloidin (Actin, Channel 3).
17
+ - pH3 (Mitotic cells, Channel 2 - Not used for segmentation).
18
+
19
+ - **Segmentations:**
20
+ - Foreground-background segmentation masks available.
21
+ - Manually refined after initial thresholding.
22
+
23
+ - **Source:** https://bbbc.broadinstitute.org/BBBC008
24
+ """
25
+
26
+ BASE_URL = "https://data.broadinstitute.org/bbbc/BBBC008"
27
+
28
+ def __init__(self):
29
+ self.local_path = os.path.join(self.GLOBAL_STORAGE_PATH, "BBBC008")
30
+ self.image_paths = [os.path.join(self.BASE_URL, "BBBC008_v1_images.zip")]
31
+ self.label_path = os.path.join(self.BASE_URL, "BBBC008_v1_foreground.zip")
32
+ self.metadata_paths = None
33
+ self.is_3d = False
34
+
35
+ super().__init__("BBBC008")
@@ -0,0 +1,39 @@
1
+ import os
2
+
3
+ from bbbc_datasets.datasets.base_dataset import BaseBBBCDataset
4
+
5
+
6
+ class BBBC010(BaseBBBCDataset):
7
+ """
8
+ BBBC010 Dataset: Live/dead assay of C. elegans exposed to pathogens.
9
+
10
+ - **Biological Application:**
11
+ Used for screening novel anti-infectives by distinguishing between live and dead C. elegans worms.
12
+ Positive control (ampicillin-treated worms) appear curved and smooth (alive).
13
+ Negative control (untreated worms) appear rod-like and textured (dead).
14
+
15
+ - **Images:**
16
+ - 100 images from a 384-well plate.
17
+ - Brightfield (Channel 1) and GFP (Channel 2).
18
+ - Image size: 696 x 520 pixels, 16-bit TIF format.
19
+
20
+ - **Segmentations:**
21
+ - **Foreground/background segmentation:** Human-corrected binary images.
22
+ - **Individual worm outlines:** Binary segmentation images for individual worms.
23
+
24
+ - **Source:** https://bbbc.broadinstitute.org/BBBC010
25
+ """
26
+
27
+ BASE_URL = "https://data.broadinstitute.org/bbbc/BBBC010"
28
+
29
+ def __init__(self):
30
+ self.local_path = os.path.join(self.GLOBAL_STORAGE_PATH, "BBBC010")
31
+ self.image_paths = [os.path.join(self.BASE_URL, "BBBC010_v2_images.zip")]
32
+ self.label_path = os.path.join(self.BASE_URL, "BBBC010_v1_foreground.zip")
33
+ self.additional_label_paths = [
34
+ os.path.join(self.BASE_URL, "BBBC010_v1_foreground_eachworm.zip")
35
+ ]
36
+ self.metadata_paths = None
37
+ self.is_3d = False
38
+
39
+ super().__init__("BBBC010")