Skip to main content

Module region_grow

Module region_grow 

Source

Constantsยง

NEIGHBOR_OFFSETS ๐Ÿ”’
Neighbor offsets: (dimension_for_weight, di, dj, dk) dimension 0 = x edges, 1 = y edges, 2 = z edges
TWO_PI ๐Ÿ”’

Functionsยง

grow_region_unwrap
Region growing phase unwrapping (matches Python implementation exactly)
idx3d ๐Ÿ”’
Convert 3D index to flat index (Fortran order / column-major, matches NIfTI) For array shape (nx, nx, ny), index [i,j,k] maps to: i + jnx + knx*ny
idx4d ๐Ÿ”’
Convert 4D index (for weights array) to flat index (Fortran order) weights layout: [dim][i][j][k] where dim is 0,1,2 for x,y,z For array shape (3, nx, nx, ny), index [dim,i,j,k] maps to: i + jnx + knxny + dimnxnynz

Type Aliasesยง

QueueItem ๐Ÿ”’
Queue item: (target_i, target_j, target_k, ref_i, ref_j, ref_k) Stores both the target voxel to unwrap AND the reference voxel to use