slitflow.img.proc module

This process module includes classes that change image structure such as frm_no and image width and height.

class SelectParam(info_path=None)[source]

Bases: Image

Select image frames based on parameter values.

This class creates a mask column based on explicit param values using slitflow.tbl.filter.MaskFromParam and selects rows using the mask column.

Parameters:
  • reqs[0] (Image) – Image for selection.

  • reqs[1] (Table) – Index Table that includes all indices corresponding to the image. The index table should be split into the same depth as the image.

  • param["index"] (list of tuple) – List of image index numbers to select. The tuple should be (index of depth=1, index of depth=2, …). If index is None, all indices of the depth is selected.

  • param["split_depth"] (int) – File split depth number.

Returns:

Selected Image.

Return type:

Image

Raises:
  • Exception – If the split depths of the image and index table are not the

  • same.

set_info(param={})[source]

Copy info from reqs[0] and add param.

static process(reqs, param)[source]

Select image frames based on parameter values.

Parameters:
  • reqs[0] (numpy.ndarray) – Image for selection.

  • reqs[1] (Table) – Index Table that includes all indices corresponding to the image. The index table should be split into the same depth as the image.

  • param["index"] (list of tuple) – List of tuple of index numbers to select. The tuple should be (index of depth=1, index of depth=2, …). If index is None, all indices of the depth is selected.

  • param["index_cols"] (list of str) – The index column names.

  • param["mask_col"] (str, optional) – The name of the mask column. Defaults to “mask”.

Returns:

Selected Table.

Return type:

Table

post_run()[source]

Remove empty data

set_index()[source]

Create index structure of this analysis data.

This step strongly depends on the analysis type. Frequently used processes are in slitflow.setindex.