livecellx.core.datasets.SingleImageDataset

class livecellx.core.datasets.SingleImageDataset(img, name=None, ext='.png', in_memory=True)[source]

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_dataset_name()

get_dataset_path()

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_sorted_times()

Get the times in the dataset

infer_shape()

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)

read_single_img_from_mem(url)

subset_by_time(min_time, max_time[, prefix])

Return a subset of the dataset based on time [min, max)

time_span()

Get the time span of the dataset

to_dask([times, ram])

convert to a dask array for napari visualization

to_json_dict()

Return the dataset info as a dictionary object

update_time2url_from_dir_path()

Update the time2url dictionary from the directory path

write_json([path, overwrite, out_dir])

Write the dataset info to a local json file.

Attributes

DEFAULT_OUT_DIR

DEFAULT_TIME