revanalyzer.metrics.pnm.PoreRadius
- class revanalyzer.metrics.pnm.PoreRadius(vectorizer, n_threads=1, resolution=1.0, show_time=False)
Bases:
BasicPNMMetric
Class describing pore radius metric.
Input:
vectorizer (HistVectorizer object): vectorizer to be used for a vector metric;
n_threads (int): number of threads used for data generation, default: 1;
resolution (float): resolution of studied sample, default: 1;
show_time (bool): Added to monitor time cost for large images, default: False.
Methods
Generates pore radius distribution for a specific subsample.
Read the metric data generated for a specific subsample.
Vizualize pore radius distribution for a specific subsample.
Vectorize the vector metric values for a given pair of subsample.
- generate(cut, cut_name, outputdir, gendatadir)
Generates pore radius distribution for a specific subsample.
Input:
cut (numpy.ndarray): 3D array representing a subsample;
cut_name (str): name of subsample;
outputdir (str): output folder;
gendatadir (str): folder with generated PNM data.
- 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’)).
- show(inputdir, step, cut_id, nbins)
Vizualize pore radius distribution for a specific subsample.
Input:
inputdir (str): path to the folder containing generated metric data for subsamples;
step (int): subsamples selection step;
cut_id (int: 0,..8): cut index;
nbins (int): number of bins in histogram.
- vectorize(v1, v2)
Vectorize the vector metric values for a given pair of subsample. Makes normalization to voxels and calls the vectorizer function.
Input:
v1 (list(dtype = float)): data for the first subsample;
v2 (list(dtype = float)): data for the second subsample.
Output:
(list(dtype = float), list(dtype = float), float) - a tuple, in which the first two elements are vectorized metric values for a given pair of subsamples, and the last one is the normalized distance between these vectors.