FMD#
- class deepinv.datasets.FMD(root: str, img_types: List[str], noise_levels: List[int] = [1, 2, 4, 8, 16], fovs: List[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], download: bool = False, transform: Callable | None = None, target_transform: Callable | None = None)[source]#
Bases:
Dataset
Dataset for Fluorescence Microscopy Denoising.
1) The Fluorescence Microscopy Denoising (FMD) dataset is dedicated toPoisson-Gaussian denoising.2) The dataset consists of 12,000 real fluorescence microscopy imagesobtained with commercial confocal, two-photon, and wide-field microscopesand representative biological samples such as cells, zebrafish,and mouse brain tissues.3) Image averaging is used to effectively obtain ground truth imagesand 60,000 noisy images with different noise levels.Raw data file structure:
self.root --- Confocal_BPAE_B --- avg16 --- 1 --- HV110_P0500510000.png | | | | | | | -- HV110_P0500510049.png | | -- 20 | -- avg2 | -- avg4 | -- avg8 | -- gt | -- raw -- ... -- WideField_BPAE_R --- ... -- Confocal_BPAE_G.tar | -- WideField_BPAE_R.tar
1) There are 12 image types :Confocal_BPAE_B, Confocal_BPAE_G, Confocal_BPAE_R, Confocal_FISH, Confocal_MICETwoPhoton_BPAE_B, TwoPhoton_BPAE_G, TwoPhoton_BPAE_R, TwoPhoton_MICEWideField_BPAE_B, WideField_BPAE_G, WideField_BPAE_R2) Each image type has its own folder.3) Each folder contains 6 subfolders- : gt, raw, avg2, avg4, avg8 and avg16.4) gt contains clean images, the others have different noise levels applied to images.5) Each subfolder has 20 subsubfolders, corresponding to the “field of view”.6) Each subsubfolder has the same 50 png file names of size (512, 512).7) 12 type of img x 5 levels of noise x 20 “fov” x 50 img = 60 000 noisy img- Parameters:
root (str) – Root directory of dataset. Directory path from where we load and save the dataset.
img_types (List[str]) – Types of microscopy image among 12.
noise_levels (List[int]) – Level of noises applied to the image among [1, 2, 4, 8, 16].
fovs (List[int]) – “Field of view”, value between 1 and 20.
download (bool) – If
True
, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again. Default at False.transform (callable, optional) – A function/transform that takes in a noisy PIL image and returns a transformed version. E.g,
torchvision.transforms.RandomCrop
target_transform (callable, optional) – A function/transform that takes in a clean PIL image and returns a transformed version. E.g,
torchvision.transforms.RandomCrop
- Examples:
Instantiate dataset and download raw data from the Internet
- ::
import shutil from deepinv.datasets import FMD img_types = [“TwoPhoton_BPAE_R”] dataset = FMD(root=”fmd”, img_types=img_types, download=True) # download raw data at root and load dataset print(len(dataset)) # check that we have 5000 images shutil.rmtree(“fmd”) # remove raw data from disk
- class NoisySampleIdentifier(img_type: str, noise_dirname: str, fov: int, fname: str)[source]#
Bases:
NamedTuple
Data structure for identifying noisy data sample files.
- Parameters:
img_type (str) – Foldername corresponding to one type of image among 12.
noise_dirname (str) – Foldername corresponding to one level of noise, ‘raw’ - level 1, ‘avg2’ - 2, ‘avg4’ - 4, ‘avg8’ - 8, ‘avg16’ - 16
fov (int) – Field of view, value between 1 and 20.
fname (str) – Filename of a png file containing 1 noisy image.