Volume Cartographer 2.27.0
ProjectMesh.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <itkCompositeTransform.h>
6
9
10namespace volcart::texturing
11{
42{
43public:
46 enum class SampleMode {
51 Rate,
53 Dimensions
54 };
56 using CompositeTransform = itk::CompositeTransform<double, 2>;
58 using Point = itk::Point<double, 2>;
59
61 ProjectMesh() = default;
66 void setMesh(const ITKMesh::Pointer& inputMesh);
73 void setUseInverseTransform(bool useInverse);
77 void setTextureDimensions(int width, int height);
79 void setPPMDimensions(int width, int height);
81 void setSampleRate(double rate);
86 void setUseFirstIntersection(bool useFirstIntersection);
94private:
96 ITKMesh::Pointer inputMesh_;
99
103 bool useInverse_{false};
104
112 int ppmWidth_{0};
116 double sampleRateX_{1.0};
118 double sampleRateY_{1.0};
119
122};
123} // namespace volcart::texturing
std::shared_ptr< CompositeTransform > Pointer
Definition: Transforms.hpp:443
A raster of a UVMap that provides a per-pixel mapping between a Volume and a Texture generated from t...
Definition: PerPixelMap.hpp:50
Generates a PerPixelMap by projecting a mesh onto an image plane.
Definition: ProjectMesh.hpp:42
void setUseInverseTransform(bool useInverse)
Invert the image transform prior to use.
CompositeTransform::Pointer tfm_
auto compute() -> PerPixelMap
Project mesh and compute PerPixelMap with given settings.
SampleMode
Target image space sampling method.
Definition: ProjectMesh.hpp:46
@ Rate
Samples per unit interval in mesh space determine PPM dimensions.
itk::Point< double, 2 > Point
Definition: ProjectMesh.hpp:58
void setTextureDimensions(int width, int height)
Set the texture image dimensions.
void setPPMDimensions(int width, int height)
Set the PPM dimensions.
void setUseFirstIntersection(bool useFirstIntersection)
Use the first mesh intersection rather than the last.
void setSampleRate(double rate)
Set the X and Y sample rate for the PPM.
void setMesh(const ITKMesh::Pointer &inputMesh)
Set the input mesh.
void setSampleMode(SampleMode mode)
Set the PPM space sampling mode.
ProjectMesh()=default
Default constructor.
void setTransform(CompositeTransform::Pointer transform)
Set the image transform from mesh texture to target.
itk::CompositeTransform< double, 2 > CompositeTransform
Definition: ProjectMesh.hpp:56
Texturing and parameterization algorithms and utilities library.