Skip to main content

Microscopy Portfolio

License PyPI Python Version CI Datasets CI codecov

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

Metadata

Release files for microscopy-portfolio 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microscopy-portfolio 0.0.5
File Size Uploaded
microscopy_portfolio-0.0.5.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for microscopy-portfolio 0.0.5
File Interpreter ABI Platform
microscopy_portfolio-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / microscopy_portfolio-0.0.5.tar.gz

Download URL microscopy_portfolio-0.0.5.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a37c4283b7ae24bb0475fc9b1766001155e391fb2f1b9c4401ef85239b2ca8a9
BLAKE2b-256 checksum
How to use checksums
8f2ee583c9c4d015dd416c3b989b016a1ebf084099bb620a0d369268dae38898
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / microscopy_portfolio-0.0.5-py3-none-any.whl

Download URL microscopy_portfolio-0.0.5-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16ed654b1d0e4380847e4fd27c86490f2e55d56e8358e71f6a7c034ae5497b85
BLAKE2b-256 checksum
How to use checksums
9521f2dbcfed81d5b78be6dc4572d8f18abde6cafb90c04bd81cfb78a5d3d04e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page