Volume Cartographer 2.27.0
Private Attributes | List of all members
volcart::texturing::ProjectMesh Class Reference

Generates a PerPixelMap by projecting a mesh onto an image plane. More...

#include <vc/texturing/ProjectMesh.hpp>

Collaboration diagram for volcart::texturing::ProjectMesh:
[legend]

Public Member Functions

void setMesh (const ITKMesh::Pointer &inputMesh)
 Set the input mesh.
 
void setTransform (CompositeTransform::Pointer transform)
 Set the image transform from mesh texture to target.
 
void setUseInverseTransform (bool useInverse)
 Invert the image transform prior to use.
 
void setSampleMode (SampleMode mode)
 Set the PPM space sampling mode.
 
void setTextureDimensions (int width, int height)
 Set the texture image dimensions.
 
void setPPMDimensions (int width, int height)
 Set the PPM dimensions.
 
void setSampleRate (double rate)
 Set the X and Y sample rate for the PPM.
 
void setUseFirstIntersection (bool useFirstIntersection)
 Use the first mesh intersection rather than the last.
 
auto compute () -> PerPixelMap
 Project mesh and compute PerPixelMap with given settings.
 

Private Attributes

ITKMesh::Pointer inputMesh_
 
PerPixelMap outputPPM_
 
CompositeTransform::Pointer tfm_
 
bool useInverse_ {false}
 
SampleMode mode_ {SampleMode::Rate}
 
int textureWidth_ {1}
 
int textureHeight_ {1}
 
int ppmWidth_ {0}
 
int ppmHeight_ {0}
 
double sampleRateX_ {1.0}
 
double sampleRateY_ {1.0}
 
bool useFirstIntersection_
 
enum class  SampleMode { Rate , Dimensions }
 Target image space sampling method. More...
 
using CompositeTransform = itk::CompositeTransform< double, 2 >
 
using Point = itk::Point< double, 2 >
 
 ProjectMesh ()=default
 Default constructor.
 

Detailed Description

Generates a PerPixelMap by projecting a mesh onto an image plane.

Constructs an oriented bounding box around a mesh, chooses the largest plane as the image plane, and iterates over the surface of this plane. At each point, projects a ray oriented with the bounding box into the mesh. The position and surface normal at the mesh intersection point are stored in the PPM.

The input mesh should separately be modified using rt_reorder_texture from registration-toolkit if the PPM should align with the texture image. Optionally, if the mesh already has a reordered texture and a separate image has been registered to that texture image, the separate target image and its registration transform can be passed. In this scenario this class will iterate over the provided target image space, first mapping each point using the transform to find its corresponding location in the mesh bounding box plane before performing the ray intersection. The inverse transform may be specified if registration was performed with the mesh texture as the fixed image.

By default, the last mesh intersection point is used for each ray, optionally this may be changed to the first intersection point.

This class uses raytracing functionality provided by the bvh library.

See also
volcart::PerPixelMap

Definition at line 41 of file ProjectMesh.hpp.

Member Typedef Documentation

◆ CompositeTransform

using volcart::texturing::ProjectMesh::CompositeTransform = itk::CompositeTransform<double, 2>

Composite transform type

Definition at line 56 of file ProjectMesh.hpp.

◆ Point

using volcart::texturing::ProjectMesh::Point = itk::Point<double, 2>

Transform point type

Definition at line 58 of file ProjectMesh.hpp.

Member Enumeration Documentation

◆ SampleMode

Target image space sampling method.

Enumerator
Rate 

Samples per unit interval in mesh space determine PPM dimensions.

Dimensions 

PPM dimensions determine image plane sample rate.

Definition at line 46 of file ProjectMesh.hpp.

Member Data Documentation

◆ inputMesh_

ITKMesh::Pointer volcart::texturing::ProjectMesh::inputMesh_
private

Input mesh

Definition at line 96 of file ProjectMesh.hpp.

◆ mode_

SampleMode volcart::texturing::ProjectMesh::mode_ {SampleMode::Rate}
private

PPM sampling mode

Definition at line 106 of file ProjectMesh.hpp.

◆ outputPPM_

PerPixelMap volcart::texturing::ProjectMesh::outputPPM_
private

Output PPM

Definition at line 98 of file ProjectMesh.hpp.

◆ ppmHeight_

int volcart::texturing::ProjectMesh::ppmHeight_ {0}
private

PerPixelMap height in pixels

Definition at line 114 of file ProjectMesh.hpp.

◆ ppmWidth_

int volcart::texturing::ProjectMesh::ppmWidth_ {0}
private

PerPixelMap width in pixels

Definition at line 112 of file ProjectMesh.hpp.

◆ sampleRateX_

double volcart::texturing::ProjectMesh::sampleRateX_ {1.0}
private

PerPixelMap sample rate in X axis

Definition at line 116 of file ProjectMesh.hpp.

◆ sampleRateY_

double volcart::texturing::ProjectMesh::sampleRateY_ {1.0}
private

PerPixelMap sample rate in Y axis

Definition at line 118 of file ProjectMesh.hpp.

◆ textureHeight_

int volcart::texturing::ProjectMesh::textureHeight_ {1}
private

Texture image height in pixels

Definition at line 110 of file ProjectMesh.hpp.

◆ textureWidth_

int volcart::texturing::ProjectMesh::textureWidth_ {1}
private

Texture image width in pixels

Definition at line 108 of file ProjectMesh.hpp.

◆ tfm_

CompositeTransform::Pointer volcart::texturing::ProjectMesh::tfm_
private

Transform from target image to PPM space

Definition at line 101 of file ProjectMesh.hpp.

◆ useFirstIntersection_

bool volcart::texturing::ProjectMesh::useFirstIntersection_
private

Use the first mesh intersection rather than the last

Definition at line 121 of file ProjectMesh.hpp.

◆ useInverse_

bool volcart::texturing::ProjectMesh::useInverse_ {false}
private

Invert transform prior to use

Definition at line 103 of file ProjectMesh.hpp.


The documentation for this class was generated from the following file: