revanalyzer.metrics.porosity.Porosity

class revanalyzer.metrics.porosity.Porosity(n_threads=1)

Bases: BasicMetric

Class describing porosity metric.

Input:

vectorizer (subclass of BasicVectorizer): vectorizer to be used for a vector metric;

n_threads (int): number of threads used for data generation.

Methods

generate

Generates porosity for a specific subsample.

read

Read the metric data generated for a specific subsample.

generate(cut, cut_name, outputdir, gendatadir=None)

Generates porosity for a specific subsample.

Input:

cut (numpy.ndarray): 3D array representing a subsample;

cut_name (str): name of subsample;

outputdir (str): output folder.

read(inputdir, step, cut_id)

Read the metric data generated for a specific subsample.

Input:

inputdir (str): path to the folder containing image;

step (int): subsamples selection step;

cut_id (int: 0,..8): cut index.

Output:

metric value (float or np.array(dtype=’float’)).