Code extracted from: https://gitlab.kitware.com/third-party/diy2.git at commit 2153469e21736806f766e59e73aff5ad790b9dfa (for/vtk-m).