Volume Cartographer 2.27.0
|
Generates a PerPixelMap by projecting a mesh onto an image plane. More...
#include <vc/texturing/ProjectMesh.hpp>
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. | |
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.
Definition at line 41 of file ProjectMesh.hpp.
using volcart::texturing::ProjectMesh::CompositeTransform = itk::CompositeTransform<double, 2> |
Composite transform type
Definition at line 56 of file ProjectMesh.hpp.
using volcart::texturing::ProjectMesh::Point = itk::Point<double, 2> |
Transform point type
Definition at line 58 of file ProjectMesh.hpp.
|
strong |
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.
|
private |
Input mesh
Definition at line 96 of file ProjectMesh.hpp.
|
private |
PPM sampling mode
Definition at line 106 of file ProjectMesh.hpp.
|
private |
Output PPM
Definition at line 98 of file ProjectMesh.hpp.
|
private |
PerPixelMap height in pixels
Definition at line 114 of file ProjectMesh.hpp.
|
private |
PerPixelMap width in pixels
Definition at line 112 of file ProjectMesh.hpp.
|
private |
PerPixelMap sample rate in X axis
Definition at line 116 of file ProjectMesh.hpp.
|
private |
PerPixelMap sample rate in Y axis
Definition at line 118 of file ProjectMesh.hpp.
|
private |
Texture image height in pixels
Definition at line 110 of file ProjectMesh.hpp.
|
private |
Texture image width in pixels
Definition at line 108 of file ProjectMesh.hpp.
|
private |
Transform from target image to PPM space
Definition at line 101 of file ProjectMesh.hpp.
|
private |
Use the first mesh intersection rather than the last
Definition at line 121 of file ProjectMesh.hpp.
|
private |
Invert transform prior to use
Definition at line 103 of file ProjectMesh.hpp.