livecellx.core.datasets.LiveCellImageDataset
- class livecellx.core.datasets.LiveCellImageDataset(dir_path=None, time2url=None, name=None, ext='tif', max_cache_size=50, max_img_num=None, force_posix_path=True, read_img_url_func=<function read_img_default>, index_by_time=True, is_windows_path=False)[source]
Dataset for loading images into RAM, possibly cache images and load them on demand. This class only contains one channel’s imaging data. For multichannel data, we assume you have a single image for each channel. For the case where your images are stored in a single file, #TODO: you can use the MultiChannelImageDataset class.
Initialize the dataset.
- Parameters
dir_path (_type_, optional) – _description_, by default None
time2url (Dict[int, str], optional) – _description_, by default None
name (str, optional) – _description_, by default “livecell-base”
ext (str, optional) – _description_, by default “tif”
max_cache_size (int, optional) – _description_, by default 50
num_imgs (_type_, optional) – _description_, by default None
force_posix_path (bool, optional) – _description_, by default True
read_img_url_func (Callable, optional) – _description_, by default read_img_default
index_by_time (bool, optional) – _description_, by default True
Methods
get_default_json_path([out_dir, posix])Return the default json path for this dataset
get_img_by_idx(idx)Get an image by some index in the times list
get_img_by_time(time)Get an image by time
get_img_by_url(url[, substr, ...])Get image by url
get_img_path(time)Get the path of the image at some time
Get the times in the dataset
Infer the shape of the images in the dataset
insert_cache(img, idx)load_from_json_dict(json_dict[, ...])Load from a json dict.
load_from_json_file(path, **kwargs)subset_by_time(min_time, max_time[, prefix])Return a subset of the dataset based on time [min, max)
Get the time span of the dataset
to_dask([times, ram])convert to a dask array for napari visualization
Return the dataset info as a dictionary object
Update the time2url dictionary from the directory path
write_json([path, overwrite, out_dir])Write the dataset info to a local json file.
Attributes