Learned priors, image denoisers and plots work with pixel images, while the forward problem works with finite element coefficients. Two linear maps connect them. Let the image have pixels with centres , and let the finite element space have basis functions (conductivity) or (potential).
Mesh → image (evaluation). Evaluate the finite element function at the pixel centres:
is sparse, with at most as many nonzeros per row as basis functions per cell, and depends only on the mesh and the image size. It can be assembled once. Pixels whose centres lie outside a non-rectangular domain receive a fill value. The transpose maps gradients in image space, for example of a learned regulariser, back to coefficient space.
Image → mesh. Two natural choices:
- Sampling (interpolation). Evaluate the image, interpolated bilinearly between pixel centres, at the nodes of the finite element space; for piecewise constants these are the cell centroids. Bilinear interpolation reproduces linear functions exactly, so linear conductivities survive a round trip on any mesh. Sampling ignores the pixels between the nodes, so fine images alias on coarse meshes.
- L2 Projection. Treat the image as a function that is constant on each pixel, and solve . This averages the pixels over each cell and preserves the integral. It is the right choice when the image is finer than the mesh. In practice the integrals are computed by quadrature, and the rule must place several points in every pixel.
Pixel-aligned meshes. If the mesh is the pixel grid itself (one quadrilateral per pixel, piecewise constant ), is a permutation and both directions are exact inverses: images and coefficient vectors are the same data in a different order. This is the natural discretisation for image-based EIT with image priors such as Diffusion Models for EIT. Adaptive refinement breaks this one-to-one correspondence. The maps above then connect the refined mesh to a fixed image grid.
Orientation. Images are usually stored row by row from the top, while coordinates grow upwards. The pixel in row and column of an image of the box has the centre .
On pixel-aligned rectangle meshes the finite element matrices are diagonalised by the Discrete Cosine Transform, which gives fast solvers and preconditioners (Fast Solvers on Rectangular Domains) and spectral norms (Spectral Sobolev Norms on Rectangles).
In ModularEIT.jl: ImageMap, to_image, from_image.
References
- S. C. Brenner, L. R. Scott (2008). The Mathematical Theory of Finite Element Methods, 3rd ed. Springer. doi:10.1007/978-0-387-75934-0