slitflow.img.calc module

class MaskArea(info_path=None)[source]

Bases: Table

Calculate mask area by counting non-zero pixel number in an image.

Parameters:
  • reqs[0] (Image) – Image stack to calculate area. Required param; length_unit, pitch.

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

Returns:

Area Table

Return type:

Table

set_index()[source]

Copy index from the required data index.

set_info(param={})[source]

Copy index information from reqs[0] and add area column.

static process(reqs, param)[source]

Calculate mask area by counting non-zero pixel number in an image.

Parameters:
  • reqs[0] (numpy.ndarray) – Image stack to calculate area.

  • param["pitch"] (int) – Length per pixel in length_unit.

Returns:

Area table

Return type:

pandas.DataFrame

post_run()[source]

Merge the index table to the split result data.