A helper package to download example datasets used in various publications and deep-learning algorithms, including data featured in N2V, P(P)N2V, DivNoising, HDN, EmbedSeg, etc.
Project description
Microscopy Portfolio
A helper package to download example datasets used in various publications by the Jug lab, including data featured in N2V, P(P)N2V, DivNoising, HDN, EmbedSeg, etc.
The complete list of datasets can be found here.
Installation
To install the portfolio in your conda environment, simply use pip
:
$ pip install microscopy-portfolio
Usage
Follow the example notebook for details on how to use the package.
The portfolio can be instantiated as follow:
from microscopy_portfolio import Portfolio
portfolio = Portfolio()
You can explore the different datasets easily:
print(portfolio)
print(portfolio.denoising)
print(portfolio.denoising.N2V_SEM)
Finally, you can download the dataset of your choice:
from pathlib import Path
data_path = Path('data')
portfolio.denoising.N2V_SEM.download(data_path)
Add a dataset to the repository
To add a dataset, subclass a PortfolioEntry
and enter the following information
(preferably in one of the current categories, e.g. denoising_datasets.py
):
class MyDataset(PortfolioEntry):
def __init__(self) -> None:
super().__init__(
name="MyDataset",
url="https://url.to.myfile/MyFile.zip",
file_name="MyFile.zip",
md5_hash="953a815333805a423b7019bd16cc3341",
description="Description of the dataset.",
license="CC-BY",
citation="Citation of the dataset',
files={
"/folder/in/the/zip": ["file1.tif", "file2.tif"], # folder can be "."
},
size=13.0, # size in MB
)
To obtain md5 hash of your file, you can run the following code:
from pathlib import Path
import hashlib
file_path = Path("path/to/myfile.zip")
hashlib.md5(open(file_path, "rb").read()).hexdigest()
Likewise, to get the size in MB of your file:
import os
os.path.getsize(file_path) / 1024 / 1024
Finally, add the file class to one of the categories (e.g. denoising) in
portfolio.py
:
class Denoising(IterablePortfolio):
def __init__(self) -> None:
self._N2V_BSD68 = N2V_BSD68()
self._N2V_SEM = N2V_SEM()
self._N2V_RGB = N2V_RGB()
self._flywing = Flywing()
# add your dataset as a private attribute
self._myDataset = MyDataset()
[...]
# and add a public getter
@property
def MyDataset(self) -> MyDataset:
return self._myDataset
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file microscopy_portfolio-0.0.5.tar.gz
.
File metadata
- Download URL: microscopy_portfolio-0.0.5.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a37c4283b7ae24bb0475fc9b1766001155e391fb2f1b9c4401ef85239b2ca8a9 |
|
MD5 | ad3ecb1f6d9bcb6b063fd267dfdad5cf |
|
BLAKE2b-256 | 8f2ee583c9c4d015dd416c3b989b016a1ebf084099bb620a0d369268dae38898 |
File details
Details for the file microscopy_portfolio-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: microscopy_portfolio-0.0.5-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16ed654b1d0e4380847e4fd27c86490f2e55d56e8358e71f6a7c034ae5497b85 |
|
MD5 | 580f8ff54484b461b7f8e1f59a69fa65 |
|
BLAKE2b-256 | 9521f2dbcfed81d5b78be6dc4572d8f18abde6cafb90c04bd81cfb78a5d3d04e |