gstlearn  0.2.1
Geostatistics & Machine Learning toolbox
Morpho.cpp File Reference
#include "geoslib_f.h"
#include "geoslib_old_f.h"
#include "geoslib_f_private.h"
#include "Enum/EMorpho.hpp"
#include "Basic/Utilities.hpp"
#include "Db/Db.hpp"
#include "Morpho/Morpho.hpp"
#include <math.h>

Functions

void _st_morpho_image_radius_define (const VectorInt &radius)
 
int _st_morpho_label_size (const VectorDouble &compnum, int nbcomp, VectorInt &sizes)
 
void _st_morpho_label_order (VectorDouble &compnum, const VectorInt &order, int nbcomp)
 
void morpho_duplicate (const BImage &imagin, BImage &imagout)
 
VectorDouble morpho_labelling (int option, int flag_size, const BImage &imagin, double ccvoid, bool verbose)
 
VectorInt morpho_labelsize (int option, const BImage &imagin)
 
void morpho_erosion (int option, const VectorInt &radius, const BImage &imagin, BImage &imagout, bool verbose)
 
void morpho_dilation (int option, const VectorInt &radius, const BImage &imagin, BImage &imagout, bool verbose)
 
void morpho_intersection (const BImage &image1, const BImage &image2, BImage &imagout, bool verbose)
 
void morpho_union (const BImage &image1, const BImage &image2, BImage &imagout, bool verbose)
 
void morpho_negation (const BImage &imagin, BImage &imagout, bool verbose)
 
int morpho_count (const BImage &imagin)
 
void morpho_opening (int option, const VectorInt &radius, const BImage &imagin, BImage &imagout, bool verbose)
 
void morpho_closing (int option, const VectorInt &radius, const BImage &imagin, BImage &imagout, bool verbose)
 
void morpho_double2imageInPlace (const VectorInt &nx, const VectorDouble &tab, double vmin, double vmax, BImage &imagout, bool verbose)
 
BImage morpho_double2image (const VectorInt &nx, const VectorDouble &tab, double vmin, double vmax, bool verbose)
 
void morpho_image2double (const BImage &imagin, int mode, double grain, double pore, VectorDouble &tab, bool verbose)
 
void morpho_distance (int option, const VectorInt &radius, bool flagDistErode, BImage &imagin, VectorDouble &dist, bool verbose)
 
VectorInt gridcell_neigh (int ndim, int option, int radius, bool flag_center, bool verbose)
 
void _morpho_angle2D (DbGrid *dbgrid, const VectorInt &radius, int iptr0)
 
void _morpho_gradients (DbGrid *dbgrid, int iptr)
 
int _db_morpho_calc (DbGrid *dbgrid, int iptr0, const EMorpho &oper, double vmin, double vmax, int option, const VectorInt &radius, bool flagDistErode, bool verbose)
 

Function Documentation

◆ _db_morpho_calc()

int _db_morpho_calc ( DbGrid dbgrid,
int  iptr0,
const EMorpho &  oper,
double  vmin,
double  vmax,
int  option,
const VectorInt radius,
bool  flagDistErode,
bool  verbose 
)

Perform a morphological operation with a DbGrid

◆ _morpho_angle2D()

void _morpho_angle2D ( DbGrid dbgrid,
const VectorInt radius,
int  iptr0 
)

Calculate the gradient orientations of a colored image

◆ _morpho_gradients()

void _morpho_gradients ( DbGrid dbgrid,
int  iptr 
)

Calculate the gradient components of a colord image

◆ _st_morpho_image_radius_define()

void _st_morpho_image_radius_define ( const VectorInt radius)

Defines the image radius (global variables)

Parameters
[in]radiusRadius of the structural element

◆ _st_morpho_label_order()

void _st_morpho_label_order ( VectorDouble compnum,
const VectorInt order,
int  nbcomp 
)

Orders the connected components using a rank array

Parameters
[in]compnumarray containing the component index
[in]orderarray containing the ordering criterion
[in]nbcompnumber of connected components

◆ _st_morpho_label_size()

int _st_morpho_label_size ( const VectorDouble compnum,
int  nbcomp,
VectorInt sizes 
)

Returns the sizes of all the connected components

Returns
Total volume of the measured connected components
Parameters
[in]compnumarray containing the component index
[in]nbcompnumber of connected components to be measured
[out]sizesarray containing the sizes of the connected components labelled from 1 to nbcomp