BBBC Segmentation Datasets (2D/3D) - A PyTorch Dataset Manager
📌 Overview
This package provides a PyTorch-compatible dataset manager for Broad Bioimage Benchmark Collection (BBBC) datasets.
It allows users to:
- Download and manage BBBC segmentation datasets automatically
- Load datasets as PyTorch
Datasetobjects - Handle 2D & 3D images properly
- Support image augmentations via
torchvision.transforms(#TODO)
🚀 Installation
Install from PyPI
pip install bbbc-datasets
Install from Source
Clone the Repository
git clone https://github.com/mario-koddenbrock/bbbc_datasets.git
cd bbbc_datasets
Install Dependencies
pip install -r requirements.txt
Dependencies:
torch,torchvision(Deep Learning Framework)numpy,tifffile,opencv-python(Image Handling)requests,matplotlib(Downloading & Visualization)
📂 Available Datasets
You can list all available BBBC datasets without downloading them. You can also filter the datasets to show only 2D, only 3D, or both types of datasets.
from examples.load_dataset import list_available_datasets
# List all datasets
list_available_datasets()
# List only 2D datasets
list_available_datasets(filter_3d=False)
# List only 3D datasets
list_available_datasets(filter_3d=True)
Output
📂 Available BBBC Datasets:
- BBBC001: Human HT29 colon-cancer cells for counting.
- BBBC002: Drosophila Kc167 cells for counting.
- BBBC003: DIC microscopy images of mouse embryos for segmentation analysis.
- BBBC004: Synthetic fluorescence microscopy images of nuclei with varying clustering probabilities.
- BBBC005: Simulated fluorescence microscopy images with varying focus blur.
- BBBC006: Z-stack fluorescence microscopy images of human U2OS cells.
- BBBC007: Drosophila Kc167 cells for cell boundary segmentation.
- BBBC008: Dataset: Fluorescence microscopy images of human HT29 colon cancer cells.
- BBBC009: Human red blood cells (DIC images).
- BBBC010: Live/dead assay of C. elegans exposed to pathogens.
- BBBC018: Human HT29 colon-cancer cells (diverse phenotypes).
- BBBC019: Collective cell migration (wound healing, DIC images).
- BBBC020: Murine bone-marrow derived macrophages (overlapping cells).
- BBBC024: 3D Synthetic HL60 Cell Line Images with Varying Clustering Probability and SNR.
- BBBC027: 3D Synthetic Colon Tissue Images with Varying SNR.
- BBBC028: Polymerized Structures in Differential Interference Contrast (DIC) Microscopy.
- BBBC029: Synthetic Differential Interference Contrast (DIC) Images.
- BBBC030: Chinese Hamster Ovary (CHO) cells (DIC images).
- BBBC032: 3D Mouse Embryo Blastocyst Cells.
- BBBC033: 3D Mouse Trophoblast Stem Cells.
- BBBC034: 3D Induced Pluripotent Human Stem Cells (hiPSC).
- BBBC035: Simulated HL60 Cells from the Cell Tracking Challenge.
- BBBC038: Kaggle 2018 Data Science Bowl - Nuclei Segmentation.
- BBBC039: Nuclei of U2OS Cells in a Chemical Screen.
- BBBC044: Mouse hippocampal presynaptic terminals (vGlut-1 and vGat).
- BBBC046: FiloData3D - Synthetic 3D Time-Lapse Imaging of A549 Cells with Filopodia.
- BBBC050: Nuclei of Mouse Embryonic Cells.
Filtering by metadata
Every dataset carries a fixed-schema DatasetMetadata object (the METADATA
class attribute, see bbbc_datasets/metadata.py)
describing its imaging setup and content. Unknown values are None — never
guessed.
from bbbc_datasets.dataset_manager import DatasetManager
# Metadata of a single dataset
meta = DatasetManager.get_metadata("BBBC044")
meta.dim # "3D"
meta.to_dict() # plain dict (JSON-serializable)
# Filter by any metadata field (no downloads, no instantiation)
DatasetManager.filter_datasets(dim="3D") # all 3D datasets
DatasetManager.filter_datasets(data_type="synthetic")
DatasetManager.filter_datasets(imaging_mode="dic", label_type="foreground")
DatasetManager.filter_datasets(task="counting")
# legacy: filter_3d=True/False is equivalent to dim="3D"/"2D"
Fields: name, title, source, dim (2D/3D), imaging_mode
(fluorescence/dic/brightfield/brightfield_fluorescence), modality
(grayscale/rgb/multichannel), resolution_um (tuple, None when not
uniform), image_size ((H, W) or (Z, H, W), None when varying),
data_type (synthetic/real), instrument, n_images, task
(segmentation/counting/detection/classification), label_type
(foreground/instance/outlines/counts/bounding_boxes/biological),
doi, license.
Dataset previews
Each dataset below is a collapsible entry with three downscaled example
images (the label mask is shown side by side when available) and the full
metadata. The thumbnails live in gallery/ and are generated from
the downloaded data:
from bbbc_datasets.dataset_manager import DatasetManager
# Regenerate the thumbnails (requires the datasets to be downloaded)
DatasetManager.gallery("gallery", examples=3, max_size=300)
# or: python -m bbbc_datasets.gallery --output gallery
Note: some sets are named "3D" by the BBBC but this package processes single 2D frames of them (
BBBC032–BBBC035,BBBC046); their metadatadimis therefore2D, matching the code'sis_3dflag.
BBBC001 — Human HT29 colon-cancer cells for counting · 2D · real · fluorescence · counting · 6 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | 512×512 | Resolution | — |
| Instrument | Cellomics ArrayScan | Images | 6 |
| Task | counting | Labels | counts |
| DOI | 10.1038/nmeth.2083 | License | CC-BY-NC-SA-3.0 |
BBBC002 — Drosophila Kc167 cells for counting · 2D · real · fluorescence · counting · 50 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | 512×512 | Resolution | — |
| Instrument | Zeiss Axiovert 200M | Images | 50 |
| Task | counting | Labels | counts |
| DOI | 10.1038/nmeth.2083 | License | CC-BY-NC-SA-3.0 |
BBBC003 — DIC microscopy images of mouse embryos for segmentation analysis · 2D · real · dic · segmentation · 15 images
| Dim | 2D | Imaging mode | dic |
| Modality | grayscale | Data type | real |
| Image size | 480×640 | Resolution | — |
| Instrument | Nikon Eclipse TE200 (20x, 0.45 NA) | Images | 15 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC004 — Synthetic fluorescence microscopy images of nuclei with varying clustering probabilities · 2D · synthetic · fluorescence · segmentation · 20 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 20 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC005 — Simulated fluorescence microscopy images with varying focus blur · 2D · synthetic · fluorescence · segmentation · 19200 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 19200 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC006 — Z-stack fluorescence microscopy images of human U2OS cells · 2D · real · fluorescence · segmentation · 1536 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 1536 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC007 — Drosophila Kc167 cells for cell boundary segmentation · 2D · real · fluorescence · segmentation · 32 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | 512×512 | Resolution | — |
| Instrument | Zeiss Axioplan 2 | Images | 32 |
| Task | segmentation | Labels | outlines |
| DOI | 10.1038/nmeth.2083 | License | CC0-1.0 |
BBBC008 — Fluorescence microscopy images of human HT29 colon cancer cells · 2D · real · fluorescence · segmentation · 24 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 24 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC009 — Human red blood cells (DIC images) · 2D · real · dic · segmentation · 5 images
| Dim | 2D | Imaging mode | dic |
| Modality | grayscale | Data type | real |
| Image size | 600×800 | Resolution | — |
| Instrument | — | Images | 5 |
| Task | segmentation | Labels | outlines |
| DOI | 10.1038/nmeth.2083 | License | CC0-1.0 |
BBBC010 — Live/dead assay of C. elegans exposed to pathogens · 2D · real · brightfield_fluorescence · segmentation · 200 images
| Dim | 2D | Imaging mode | brightfield_fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 200 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC018 — Human HT29 colon-cancer cells (diverse phenotypes) · 2D · real · fluorescence · segmentation · 168 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | 512×512 | Resolution | — |
| Instrument | Cellomics ArrayScan | Images | 168 |
| Task | segmentation | Labels | outlines |
| DOI | 10.1038/nmeth.2083 | License | CC-BY-NC-SA-3.0 |
BBBC019 — Collective cell migration (wound healing, DIC images) · 2D · real · dic · segmentation · 165 images
| Dim | 2D | Imaging mode | dic |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 165 |
| Task | segmentation | Labels | foreground |
| DOI | 10.1038/nmeth.2083 | License | CC-BY-3.0 |
BBBC020 — Murine bone-marrow derived macrophages (overlapping cells) · 2D · real · fluorescence · segmentation · 75 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | multichannel | Data type | real |
| Image size | 1040×1388 | Resolution | — |
| Instrument | — | Images | 75 |
| Task | segmentation | Labels | instance |
| DOI | 10.1038/nmeth.2083 | License | CC-BY-NC-SA-3.0 |
BBBC024 — 3D Synthetic HL60 Cell Line Images with Varying Clustering Probability and SNR · 3D · synthetic · fluorescence · segmentation · 90 images
| Dim | 3D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 90 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC027 — 3D Synthetic Colon Tissue Images with Varying SNR · 3D · synthetic · fluorescence · segmentation · 30 images
| Dim | 3D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 30 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC028 — Polymerized Structures in Differential Interference Contrast (DIC) Microscopy · 2D · real · dic · segmentation · 60 images
| Dim | 2D | Imaging mode | dic |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 60 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC029 — Synthetic Differential Interference Contrast (DIC) Images · 2D · synthetic · dic · segmentation · 218 images
| Dim | 2D | Imaging mode | dic |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 218 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC030 — Chinese Hamster Ovary (CHO) cells (DIC images) · 2D · real · dic · segmentation · 60 images
| Dim | 2D | Imaging mode | dic |
| Modality | grayscale | Data type | real |
| Image size | 1032×1376 | Resolution | — |
| Instrument | Olympus Cell-R (20x) | Images | 60 |
| Task | segmentation | Labels | outlines |
| DOI | — | License | CC-BY-3.0 |
BBBC032 — 3D Mouse Embryo Blastocyst Cells · 2D · real · fluorescence · segmentation · 4 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 4 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC033 — 3D Mouse Trophoblast Stem Cells · 2D · real · fluorescence · segmentation · 2 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 2 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC034 — 3D Induced Pluripotent Human Stem Cells (hiPSC) · 2D · real · brightfield_fluorescence · segmentation · 10 images
| Dim | 2D | Imaging mode | brightfield_fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 10 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC035 — Simulated HL60 Cells from the Cell Tracking Challenge · 2D · synthetic · fluorescence · segmentation · 230 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 230 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC038 — Kaggle 2018 Data Science Bowl - Nuclei Segmentation · 2D · real · fluorescence · segmentation · 664 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 664 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC039 — Nuclei of U2OS Cells in a Chemical Screen · 2D · real · fluorescence · segmentation · 200 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | 520×696 | Resolution | — |
| Instrument | — | Images | 200 |
| Task | segmentation | Labels | instance |
| DOI | — | License | — |
BBBC044 — Mouse hippocampal presynaptic terminals (vGlut-1 and vGat) · 3D · real · fluorescence · counting · 12 images
| Dim | 3D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | 15×1024×1024 | Resolution | — |
| Instrument | Zeiss LSM 710 (63x oil) | Images | 12 |
| Task | counting | Labels | — |
| DOI | 10.3389/fnana.2018.00037 | License | CC-BY-NC-SA-3.0 |
BBBC046 — FiloData3D - Synthetic 3D Time-Lapse Imaging of A549 Cells with Filopodia · 2D · synthetic · fluorescence · segmentation · 30 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | synthetic |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 30 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
BBBC050 — Nuclei of Mouse Embryonic Cells · 2D · real · fluorescence · segmentation · 165 images
| Dim | 2D | Imaging mode | fluorescence |
| Modality | grayscale | Data type | real |
| Image size | varies | Resolution | — |
| Instrument | — | Images | 165 |
| Task | segmentation | Labels | foreground |
| DOI | — | License | — |
🎨 Visualizing Dataset Samples
Display First Image from Each Dataset
Requires downloading datasets first!
You can display samples from the datasets. Similar to listing datasets, you can filter the samples to show only 2D, only 3D, or both types of datasets.
from examples.load_dataset import display_dataset_samples
# Display samples from all datasets
display_dataset_samples()
# Display samples from only 2D datasets
display_dataset_samples(filter_3d=False)
# Display samples from only 3D datasets
display_dataset_samples(filter_3d=True)
📥 Download and Load a Dataset
Load a Dataset as a PyTorch Dataset
from bbbc_datasets.datasets.bbbc004 import BBBC004
from torch.utils.data import DataLoader
# Load BBBC004 dataset
dataset = BBBC004()
# Create a DataLoader
dataloader = DataLoader(dataset, batch_size=4, shuffle=True)
# Iterate through data
for images, labels in dataloader:
print(f"Batch shape: {images.shape}, Labels: {labels.shape if labels is not None else 'None'}")
DatasetManager.filter_datasets filters the dataset classes by metadata
without triggering any downloads (see Filtering by metadata):
from bbbc_datasets.dataset_manager import DatasetManager
# All datasets
datasets_all = DatasetManager.filter_datasets()
# All 3D datasets (legacy filter_3d still works)
datasets_3d = DatasetManager.filter_datasets(filter_3d=True)
# Or filter by any metadata field
datasets_dic = DatasetManager.filter_datasets(imaging_mode="dic")
Dataset-Specific Options
Some datasets ship in several variants and can be loaded selectively:
# Only one of the eight wound-healing subsets of BBBC019
dataset = BBBC019(subset="MDCK")
# Only the vGat marker of the 3D BBBC044 stacks
dataset = BBBC044(marker="vgat")
🛠 Running Tests
Validate Dataset URLs
Checks if all dataset URLs are reachable 🌍
python -m unittest tests/test_urls.py
Verify Dataset Loading
Ensures datasets can be loaded and accessed correctly 🛠
python -m unittest tests/test_dataset_loading.py
📝 Up-next
- Complete the non-BBBC stubs:
cellposeandlivecellare partial,sartoriusneeds its class body fixed, andevican/isbi15are empty placeholders. - Cell Painting profiling sets (BBBC025/036/047): multi-channel image-profiling data, a different paradigm from the current segmentation focus.
- Biological-label sets (BBBC041/042/045): only bounding boxes / biological labels, no segmentation masks yet.
🆕 v1.0.0 highlights
- 9 new BBBC datasets: BBBC001, BBBC002, BBBC007, BBBC009, BBBC018, BBBC019, BBBC020, BBBC030, BBBC044 (now 27 total).
- Robust downloading: per-file markers so multi-archive datasets (e.g. the 8 BBBC019 subsets) no longer skip files; metadata files are downloaded into a
metadata/folder. - Correct image/label discovery: deep recursive listing,
__MACOSXjunk filtering, and exact stem matching before fuzzy matching (fixes BBBC039 label mismatches). - Working PyTorch wrapper:
DatasetManager.get_dataset/DataLoadernow return correct per-sample(image, label)tensors for 2D, 3D, RGB and ArrayScan.DIBinputs.
🙌 Contributing
Contributions are welcome! If you find issues or want to add new features, feel free to:
- Submit a Pull Request
- Report Issues in the GitHub Issues section
📜 License
This project is licensed under the MIT License.
Metadata
Release files for bbbc-datasets 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bbbc_datasets-1.1.0.tar.gz | 44.3 kB | Without provenance | Details for bbbc_datasets-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bbbc_datasets-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for bbbc_datasets-1.1.0-py3-none-any.whl |
Total release size: 105.3 kB
Release files / bbbc_datasets-1.1.0.tar.gz
| Download URL | bbbc_datasets-1.1.0.tar.gz |
|---|---|
| Size | 44.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
916a8d6e9dd9a001502a89743f98dcf47325fecf8a97091e0ca6f790594692f2
|
|
BLAKE2b-256 checksum How to use checksums |
a6ca8cebfa6fe0a9b876df923b6e506a177ca48ca12606b1cd6571fa01415ddf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0
|
Release files / bbbc_datasets-1.1.0-py3-none-any.whl
| Download URL | bbbc_datasets-1.1.0-py3-none-any.whl |
|---|---|
| Size | 61.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a68277b5e4698ec2b8c8e2dd9a43e6f657ac1333448821b48629e227c5973376
|
|
BLAKE2b-256 checksum How to use checksums |
d122bc96958d72e83ec7d55a9556de7f2e062ca2051946c4add91a4542ef1f29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.0
|
Security for bbbc-datasets 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.