dcnum.feat.feat_background.base
Attributes
Classes
Base class for background computation |
Functions
Return dictionary of background computation methods |
Module Contents
- dcnum.feat.feat_background.base.mp_spawn = None
- class dcnum.feat.feat_background.base.Background(input_data, output_path, compress=True, num_cpus=None, **kwargs)[source]
Bases:
abc.ABCBase class for background computation
- Parameters:
input_data (array-like or pathlib.Path) – The input data can be either a path to an HDF5 file with the “evtens/image” dataset or an array-like object that behaves like an image stack (first axis enumerates events)
output_path (pathlib.Path) – Path to the output file. If input_data is a path, you can set output_path to the same path to write directly to the input file. The data are written in the “events/image_bg” dataset in the output file.
compress (bool) – Whether to compress background data. Set this to False for faster processing.
num_cpus (int) – Number of CPUs to use for median computation. Defaults to dcnum.common.cpu_count().
kwargs – Additional keyword arguments passed to the subclass.
- logger
- output_path
- kwargs
background keyword arguments
- num_cpus = None
number of CPUs used
- image_proc
fraction of images that have been processed
- hdin = None
HDF5Data instance for input data
- h5in = None
input h5py.File
- h5out = None
output h5py.File
- paths_ref = []
reference paths for logging to the output .rtdc file
- image_shape
shape of event images
- image_count
number of images in the input data
- writer
- get_ppid()[source]
Return a unique background pipeline identifier
The pipeline identifier is universally applicable and must be backwards-compatible (future versions of dcnum will correctly acknowledge the ID).
The segmenter pipeline ID is defined as:
KEY:KW_BACKGROUND
Where KEY is e.g. “sparsemed” or “rollmed”, and KW_BACKGROUND is a list of keyword arguments for check_user_kwargs, e.g.:
kernel_size=100^batch_size=10000
which may be abbreviated to:
k=100^b=10000
- classmethod get_ppid_from_ppkw(kwargs)[source]
Return the PPID based on given keyword arguments for a subclass
- static get_ppkw_from_ppid(bg_ppid)[source]
Return keyword arguments for any subclass from a PPID string