/* voxb_grayform.h --- erosion and dilation of PPV arrays. */ /* Last edited on 2021-07-02 21:32:35 by jstolfi */ #ifndef voxb_grayform_H #define voxb_grayform_H #define _GNU_SOURCE #include #include #include #include ppv_array_t *voxb_grayform_compute(ppv_array_t *A, ppv_nbits_t bps, ppv_size_t ord); /* Computes the grayscale (local mean density) transform of the binary array {A}. The result is an array {G} with same number of dimensions {d} as {A}. There will be one voxel of {G} for every cubical block {B[ix]} of voxels of {A} with size {s = 2*ord+1} along every axis. The value of that voxel of {G[ix]} is the weighted average of the voxels of {A} around the center of {B[ix]}, that is around the voxel {A[jx]} with index {jx[k] = s*ix[k] + ord} in each axis {k}. The average actually uses a Hahn (shifted cosine) window that extends {2*ord} voxels from {A[jx]} in every direction. */ #endif