Skip to content

Commit

Permalink
Merge pull request #48 from CAREamics/care_dataset
Browse files Browse the repository at this point in the history
Add U2OS sample
  • Loading branch information
jdeschamps committed Apr 27, 2024
2 parents 8ee2416 + b9320aa commit 5427824
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 23 deletions.
13 changes: 13 additions & 0 deletions datasets/datasets.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@
"membrane",
"fluorescence"
]
},
"CARE_U2OS": {
"URL": "https://dl-at-mbl-2023-data.s3.us-east-2.amazonaws.com/image_restoration_data.zip",
"Description": "CARE dataset used during the MBL course. Original data fromthe image set BBBC006v1 of the Broad Bioimage Benchmark Collection (Ljosa et al., Nature Methods, 2012). The iamges were corrupted with artificial noise.",
"Citation": "We used the image set BBBC006v1 from the Broad Bioimage Benchmark Collection [Ljosa et al., Nature Methods, 2012].",
"License": "CC0-1.0",
"Hash": "4112d3666a4f419bbd51ab0b7853c12e16c904f89481cbe7f1a90e48f3241f72",
"File size": "760.5 MB",
"Tags": [
"denoising",
"nuclei",
"fluorescence"
]
}
},
"denoiseg": {
Expand Down
40 changes: 17 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ description = "A helper package to download example datasets used in various pub
readme = "README.md"
requires-python = ">=3.8"
license = { text = "BSD-3-Clause" }
authors = [
{ name = "Joran Deschamps", email = "joran.deschamps@fht.org" },
]
authors = [{ name = "Joran Deschamps", email = "joran.deschamps@fht.org" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
Expand All @@ -47,13 +45,11 @@ dev = [
"black",
"ipython",
"mypy",
"pdbpp", # https://github.com/pdbpp/pdbpp
"rich", # https://github.com/Textualize/rich
"pdbpp", # https://github.com/pdbpp/pdbpp
"rich", # https://github.com/Textualize/rich
"ruff",
]
example = [
"jupyter"
]
example = ["jupyter"]

[project.urls]
homepage = "https://github.com/juglab-torch/careamics-portfolio"
Expand All @@ -73,15 +69,15 @@ line-length = 88
target-version = "py38"
src = ["src"]
# https://beta.ruff.rs/docs/rules/
select = [
"E", # style errors
"W", # style warnings
"F", # flakes
"D", # pydocstyle
"I", # isort
"UP", # pyupgrade
lint.select = [
"E", # style errors
"W", # style warnings
"F", # flakes
"D", # pydocstyle
"I", # isort
"UP", # pyupgrade
# "S", # bandit
"C4", # flake8-comprehensions
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"RUF", # ruff-specific rules
Expand All @@ -91,7 +87,7 @@ select = [
# otherwise, see:
# https://beta.ruff.rs/docs/faq/#does-ruff-support-numpy-or-google-style-docstrings
# https://github.com/charliermarsh/ruff/issues/2606
ignore = [
lint.ignore = [
"D100", # Missing docstring in public module
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
Expand All @@ -101,9 +97,9 @@ ignore = [
"D413", # Missing blank line after last section
"D416", # Section name should end with a colon
]
ignore-init-module-imports = true
lint.ignore-init-module-imports = true

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S"]
"setup.py" = ["D"]

Expand All @@ -127,9 +123,7 @@ pretty = true
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
markers = [
"dataset: slow tests due to large dataset download",
]
markers = ["dataset: slow tests due to large dataset download"]


# https://coverage.readthedocs.io/en/6.4/config.html
Expand All @@ -141,7 +135,7 @@ exclude_lines = [
"except ImportError",
"\\.\\.\\.",
"raise NotImplementedError()",
"except PackageNotFoundError"
"except PackageNotFoundError",
]
[tool.coverage.run]
source = ["careamics_portfolio"]
Expand Down
38 changes: 38 additions & 0 deletions src/careamics_portfolio/denoising_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,44 @@
DENOISING = "denoising"


class CARE_U2OS(PortfolioEntry):
"""U2OS cells with artificial noise dataset.
Attributes
----------
portfolio (str): Name of the portfolio to which the dataset belong.
name (str): Name of the dataset.
url (str): URL of the dataset.
description (str): Description of the dataset.
license (str): License of the dataset.
citation (str): Citation to use when referring to the dataset.
file_name (str): Name of the downloaded file.
hash (str): SHA256 hash of the downloaded file.
size (int): Size of the dataset in MB.
tags (list[str]): List of tags associated to the dataset.
is_zip (bool): Whether the dataset is a zip file.
"""

def __init__(self) -> None:
super().__init__(
portfolio=DENOISING,
name="CARE_U2OS",
url="https://dl-at-mbl-2023-data.s3.us-east-2.amazonaws.com/"
"image_restoration_data.zip",
file_name="image_restoration_data.zip",
sha256="4112d3666a4f419bbd51ab0b7853c12e16c904f89481cbe7f1a90e48f3241f72",
description="CARE dataset used during the MBL course. Original data from"
"the image set BBBC006v1 of the Broad Bioimage Benchmark Collection "
"(Ljosa et al., Nature Methods, 2012). The iamges were corrupted with "
"artificial noise.",
license="CC0-1.0",
citation="We used the image set BBBC006v1 from the Broad Bioimage "
"Benchmark Collection [Ljosa et al., Nature Methods, 2012].",
size=760.5,
tags=["denoising", "nuclei", "fluorescence"],
)


class N2N_SEM(PortfolioEntry):
"""SEM dataset.
Expand Down
14 changes: 14 additions & 0 deletions src/careamics_portfolio/portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
SegFlywing,
)
from .denoising_datasets import (
CARE_U2OS,
DENOISING,
N2N_SEM,
N2V_BSD68,
Expand Down Expand Up @@ -308,6 +309,7 @@ class Denoising(IterablePortfolio):
N2V_RGB (N2V_RGB): RGB dataset.
flywing (Flywing): Flywing dataset.
Convallaria (Convallaria): Convallaria dataset.
CARE_U2OS (CARE_U2OS): CARE_U2OS dataset.
"""

def __init__(self) -> None:
Expand All @@ -317,6 +319,7 @@ def __init__(self) -> None:
self._N2V_RGB = N2V_RGB()
self._flywing = Flywing()
self._Convallaria = Convallaria()
self._CARE_U2OS = CARE_U2OS()

super().__init__(DENOISING)

Expand Down Expand Up @@ -386,6 +389,17 @@ def Convallaria(self) -> Convallaria:
"""
return self._Convallaria

@property
def CARE_U2OS(self) -> CARE_U2OS:
"""CARE_U2OS dataset.
Returns
-------
CARE_U2OS
CARE_U2OS dataset.
"""
return self._CARE_U2OS


@dataclass
class PortfolioManager:
Expand Down
1 change: 1 addition & 0 deletions src/careamics_portfolio/registry/registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ denoising-N2V_SEM 7600a17c3dbd4992ea547be12458640c21e797eef6a9f776f36ba5890f2685
denoising-N2V_RGB 4c2010c6b5c253d3a580afe744cbff969d387617c9dde29fea4463636d285657 https://download.fht.org/jug/n2v/RGB.zip
denoising-Flywing 01106b6dc096c423babfca47ef27059a01c2ca053769da06e8649381089a559f https://download.fht.org/jug/n2v/flywing-data.zip
denoising-Convallaria 8a2ac3e2792334c833ee8a3ca449fc14eada18145f9d56fa2cb40f462c2e8909 https://cloud.mpi-cbg.de/index.php/s/BE8raMtHQlgLDF3/download
denoising-CARE_U2OS 4112d3666a4f419bbd51ab0b7853c12e16c904f89481cbe7f1a90e48f3241f72 https://dl-at-mbl-2023-data.s3.us-east-2.amazonaws.com/image_restoration_data.zip

# denoiseg
denoiseg-DSB2018_n0 729d7683ccfa1ad437f666256b23e73b3b3b3da6a8e47bb37303f0c64376a299 https://zenodo.org/record/5156969/files/DSB2018_n0.zip?download=1
Expand Down

0 comments on commit 5427824

Please sign in to comment.