graintrace.hedm_stitching_techniques#
HEDM scan-stitching techniques (region-based, naive) and support utilities.
Region-based multi-scan HEDM z-stitching (RegionBaseStitching).
- class graintrace.hedm_stitching_techniques.region_base_stitching.RegionBaseStitching(scan_files, output_csv, position_tolerance, orientation_tolerance, radius_tolerance, weights, min_neighbors=5, orientation_convention='bunge', orientation_units='degrees', symmetry='432', output_column=None, refine_extents=False, tess_weighted=True, update_centroid=False, tess_dir=None, neper_env=None, xy_bounding_box=None)[source]#
Bases:
objectIteratively stitch overlapping HEDM scan layers into one grain set.
- Parameters:
scan_files (List[str])
output_csv (str)
position_tolerance (float)
orientation_tolerance (float)
radius_tolerance (float)
min_neighbors (int)
orientation_convention (str)
orientation_units (str)
symmetry (str)
output_column (Optional[List[str]])
refine_extents (bool)
tess_weighted (bool)
update_centroid (bool)
tess_dir (Optional[str])
xy_bounding_box (Optional[List[float]])
Per-grain cell geometry from a Neper tessellation, for HEDM stitching.
Given a set of grain centroids (one scan or a stitched accumulator), build a
(Laguerre / power) Voronoi tessellation at the measured centroids, with no CVT
relaxation, and read back each grain’s true polyhedral z-extent [Zmin, Zmax]
and volume centroid. This replaces the equivalent-sphere z +/- GrainRadius
approximation used by the region classifier for elongated / anisotropic grains.
- graintrace.hedm_stitching_techniques.scan_tessellation.default_neper_env()[source]#
Subprocess environment for a user-installed NEPER.
Resolves the
neperbinary viagraintrace.neper_env(NEPER env var -> tools.json -> PATH) and puts its bin/lib directories onPATH/LD_LIBRARY_PATHso a self-built NEPER finds its GSL/OpenBLAS libs. Falls back to a plainos.environcopy when NEPER cannot be located.- Return type:
- graintrace.hedm_stitching_techniques.scan_tessellation.compute_cell_geometry(df, bbox, weighted=True, coord_cols=('X', 'Y', 'Z'), radius_col='GrainRadius', work_dir=None, env=None, neper_bin='neper', keep_files=False)[source]#
Tessellate
df’s grains insidebboxand return per-grain cell geometry.The tessellation is a (Laguerre when
weighted) Voronoi diagram of the exact measured centroids;-morphooptistop iter=0disables CVT relaxation so cells stay anchored at the grains. Cell i corresponds to input row i (the same seed-order assumptionVoronoiMeshBuilderrelies on for orientation mapping).- Parameters:
df (DataFrame) – grain table with
coord_cols(andradius_colwhenweighted).bbox (Sequence[float]) – domain
[xlo, xhi, ylo, yhi, zlo, zhi]. z should be the scan FOV window so that a cell touching the z-limit means the grain is truncated.weighted (bool) – Laguerre weight = effective grain volume
(4/3)*pi*r**3.work_dir (str | None) – scratch dir for Neper I/O (a temp dir is used and removed if None).
env (dict | None) – subprocess env (defaults to
default_neper_env()).radius_col (str)
neper_bin (str)
keep_files (bool)
- Returns:
DataFrame indexed like
dfwith columnsZmin, Zmax, Xc, Yc, Zc, Vol.- Return type: