upxo.pxtalops.Characterizer module

class upxo.pxtalops.Characterizer.mcgs_mchar_2d(xgr=None, ygr=None, mcstates=None)[source]

Bases: object

2D morphological characterisation helpers for MCGS fields / subsets.

Operates on state or label fields (fmat / lgi) with optional sliding-window subsets, grain detection, and property extraction. Used by representativeness tooling (e.g. KREPR) and characterisation scripts under scripts/MCGS2d_characterization.

Example workflow (see scripts/MCGS2d_characterization)

  1. Build or load a synthetic 2D grain structure

  2. Extract spatial subsets from a temporal slice

  3. Characterise each subset (grain count / morphology)

xgr
ygr
set_fmat(fmat, fmin, fmax)[source]

Set or update fmat.

make_fmat_subsets(hsize=None, vsize=None)[source]

Build and return fmat subsets.

find_grains(library='skimage', fmat=None, kernel_order=2)[source]

Find grains.

characterize_all_subsets(fmats)[source]

Characterize all subsets.

characterize_subsets(fmats, alongh, alongv)[source]

Characterize subsets.

fmat
fmin
fmax
lgi
ngrains