upxo.ggrowth.make3d module

Helpers to build 3D voxel volumes from stacks of 2D MC / grain-structure slices.

Not a substitute for full 3D Potts simulation (mcgs with dim=3). Used to reconstruct a 3D state or LFI array and a PyVista grid from temporal or spatial 2D stacks for visualisation and analysis.

Main type: voxel_from_pixel — assemble sstack / gsstack into 3D s / lfi and pvgrid.

class upxo.ggrowth.make3d.voxel_from_pixel(STACK, meta_dict={'creation': 'from_sstack'})[source]

Bases: object

Assemble a 3D voxel volume from stacked 2D MC / GS slices.

Not a full 3D Potts simulation (use mcgs with dashboard dim=3). Stacks temporal or spatial 2D state / grain-structure maps into 3D s / lfi arrays and a PyVista grid for visualisation and analysis.

Constructors

  • from_sstack(sstack) — stack of state arrays

  • from_gsstack(gsstack) — stack of UPXO GS objects (uses gs.s)

  • from_gsgen(...) — generate slices via MCGS then stack

gsstack

UPXO grain-structure stack when created from GS objects.

Type:

dict or None

sstack

State-array stack.

Type:

dict or None

s

Reconstructed 3D state volume.

Type:

np.ndarray

lfi

3D labelled feature / grain ID volume (LFI; analogous to MCGS lgi).

Type:

np.ndarray

pvgrid

PyVista uniform grid for 3D visualisation.

meta_dict

Creation path and related metadata (creation key).

Type:

dict

meta_dict
gsstack
sstack
classmethod from_gsstack(gsstack, meta_dict={})[source]

Construct this instance from gsstack.

classmethod from_sstack(sstack, meta_dict={})[source]

Construct this instance from sstack.

classmethod from_gsgen(input_dashboard=None, meta_dict={}, retain_gsdb=False)[source]

Construct this instance from gsgen.

classmethod from_empty()[source]

Construct this instance from empty.

stack()[source]

Stack.

add_slice(location, gs, gstype='2D')[source]

Add or insert slice.

find_cells(method, connectivity=3)[source]

Find cells.

build_fids()[source]

Build and return fids.

build_coords()[source]

Build and return coords.

build_rep_coords()[source]

Build and return rep coords.

build_lfi_s()[source]

Build and return lfi s.

build_s_lfi()[source]

Build and return s lfi.

build_pvgrid(db='s', origin=(0, 0, 0), spacing=(1.0, 1.0, 1.0))[source]

Build and return pvgrid.

see_stack(db='s', opacity='linear', cmap='nipy_spectral')[source]

See stack.

s
q
lfi
pvgrid
fid
s_fid
fid_s
coords
rep_coords
section(db='s', axis=0, location=0)[source]

Section.

see_section(db='s', axis=0, location=0, preset='minimal')[source]

See section.