Volume Cartographer 2.27.0
Classes | Functions
volcart::texturing Namespace Reference

Texturing and parameterization algorithms and utilities library. More...

Classes

class  AlignmentMarkerGenerator
 Add 2D alignment markers to textured meshes. More...
 
class  AngleBasedFlattening
 Parameterize a mesh using ABF++. More...
 
class  CompositeTexture
 Generate a texture image using a variety of composite volume filters. More...
 
class  FlatteningAlgorithm
 
class  IntegralTexture
 Generate a Texture by taking the discrete integral (summation) of the neighborhood adjacent to a point. More...
 
class  IntersectionTexture
 Generate a Texture by intersection with a Volume. More...
 
class  LayerTexture
 Generate a Texture of layered images. More...
 
struct  LStretchMetrics
 L stretch error metric output struct. More...
 
class  OrthographicProjectionFlattening
 Computes a 2D parameterization of a triangular mesh using orthographic projection. More...
 
class  PPMGenerator
 Generates a PerPixelMap from an ITKMesh and a UVMap. More...
 
class  ProjectMesh
 Generates a PerPixelMap by projecting a mesh onto an image plane. More...
 
class  ScaleMarkerGenerator
 Add a scale marker (ruler or reference image) to a Texture image. More...
 
class  TexturingAlgorithm
 
class  ThicknessTexture
 Generate a Texture using the thickness of the segmented layer. More...
 

Functions

template<typename ErrContainer >
cv::Mat PlotPerFaceError (const cv::Mat &cellMap, const ErrContainer &errorMap, float defaultValue=0)
 Plot generic per-face error information into an image. More...
 
LStretchMetrics LStretch (const ITKMesh::Pointer &mesh3D, const ITKMesh::Pointer &mesh2D)
 Calculate the L2 and LInf stretch between a 2D and 3D mesh. More...
 
LStretchMetrics InvertLStretchMetrics (const LStretchMetrics &metrics)
 Calculates the inverse LStretchMetrics plotting error relative to the 3D mesh. More...
 
std::vector< cv::Mat > PlotLStretchError (const LStretchMetrics &metrics, const cv::Mat &cellMap, ColorMap cm=ColorMap::Plasma, bool drawLegend=false)
 Plot per-face L stretch error metrics. More...
 
auto GenerateCellMap (const ITKMesh::Pointer &mesh, const UVMap::Pointer &uv, std::size_t height, std::size_t width) -> cv::Mat
 Generate a cell map image. More...
 

Detailed Description

Texturing and parameterization algorithms and utilities library.

Function Documentation

◆ GenerateCellMap()

auto volcart::texturing::GenerateCellMap ( const ITKMesh::Pointer &  mesh,
const UVMap::Pointer uv,
std::size_t  height,
std::size_t  width 
) -> cv::Mat

Generate a cell map image.

The cell map contains the 3D face assignment for each pixel in a virtually unwrapped image. Normally the cell map is created as a by-product of running a PPMGenerator. However, older PPM files may not have a cell map, so this method is provided as a convenience.

Note
Cell maps have always been generated, but were not serialized until version 2.22. That version also introduced a more reliable method for generating cell maps which may not produce the exact same results as the previous method. As such, the cell map generated by this function may not exactly correspond with the cell map used to generate an old PPM.

◆ InvertLStretchMetrics()

LStretchMetrics volcart::texturing::InvertLStretchMetrics ( const LStretchMetrics metrics)

Calculates the inverse LStretchMetrics plotting error relative to the 3D mesh.

The LStretch functions calculates the L stretch metrics from 2D-to-3D, but this library is generally interested in the stretch from 3D-to-2D. This function inverts the L stretch metrics as follows:

  • L2 = 1 / L2
  • LInf = max(1 / {Per-face LInf})
  • {Per-face L2} = 1 / {Per-face L2}
  • {Per-face LInf} = 1 / {Per-face LInf}