Volume Cartographer 2.27.0
IntegralTexture.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstdint>
6
9
10namespace volcart::texturing
11{
19{
20public:
31 enum class WeightMethod { None = 0, Linear, ExpoDiff };
32
45
55 enum class ExpoDiffBaseMethod { Mean = 0, Mode, Manual };
56
59 using Pointer = std::shared_ptr<IntegralTexture>;
60
62 static auto New() -> Pointer;
63
65 IntegralTexture() = default;
67 ~IntegralTexture() override = default;
73 auto operator=(const IntegralTexture&) -> IntegralTexture& = default;
85
92 void setClampValuesToMax(bool b);
93
95 [[nodiscard]] auto clampValuesToMax() const -> bool;
96
105 void setClampMax(std::uint16_t m);
106
108 [[nodiscard]] auto clampMax() const -> std::uint16_t;
109
116
118 [[nodiscard]] auto weightMethod() const -> WeightMethod;
119
126
128 [[nodiscard]] auto linearWeightDirection() const -> LinearWeightDirection;
129
135
137 [[nodiscard]] auto exponentialDiffExponent() const -> int;
138
146
148 [[nodiscard]] auto exponentialDiffBaseMethod() const -> ExpoDiffBaseMethod;
149
152
154 [[nodiscard]] auto exponentialDiffBaseValue() const -> double;
155
165
167 [[nodiscard]] auto exponentialDiffSuppressBelowBase() const -> bool;
172 auto compute() -> Texture override;
175private:
178
180 bool clampToMax_{false};
181
183 std::uint16_t clampMax_{std::numeric_limits<uint16_t>::max()};
184
186 WeightMethod weight_{WeightMethod::None};
187
190
193
195 LinearWeightDirection linearWeight_{LinearWeightDirection::Positive};
196
199
202
205
208
210 ExpoDiffBaseMethod expoDiffBaseMethod_{ExpoDiffBaseMethod::Mean};
211
214
216 double expoDiffBase_{0};
217
220
223
225 auto expodiff_intersection_pts_() -> std::vector<std::uint16_t>;
226
228 auto expodiff_mean_base_() -> double;
229
231 auto expodiff_mode_base_() -> double;
232
235};
236
237} // namespace volcart::texturing
Base class for neighborhood generating classes.
std::shared_ptr< NeighborhoodGenerator > Pointer
Generate a Texture by taking the discrete integral (summation) of the neighborhood adjacent to a poin...
IntegralTexture(IntegralTexture &)=default
void setLinearWeightDirection(LinearWeightDirection w)
Set the linear weight direction.
auto apply_weights_(NDArray< double > &n) -> NDArray< double >
auto weightMethod() const -> WeightMethod
Set the weighting method.
void setClampMax(std::uint16_t m)
The maximum intensity value allowed in neighborhood prior to integration.
ExpoDiffBaseMethod
Exponential difference base calculation method.
std::shared_ptr< IntegralTexture > Pointer
void setExponentialDiffBaseMethod(ExpoDiffBaseMethod m)
Set the method used to calculate the Exponential Difference base value.
auto operator=(const IntegralTexture &) -> IntegralTexture &=default
auto expodiff_intersection_pts_() -> std::vector< std::uint16_t >
void setExponentialDiffExponent(int e)
Set the weighting exponent used by Exponential Difference weighting.
auto apply_linear_weights_(NDArray< double > &n) -> NDArray< double >
auto exponentialDiffBaseValue() const -> double
Set the base value for Exponential Difference weighting.
static auto New() -> Pointer
NeighborhoodGenerator::Pointer gen_
void setGenerator(NeighborhoodGenerator::Pointer g)
Set the Neighborhood generator.
auto exponentialDiffSuppressBelowBase() const -> bool
When enabled, do not integrate intensity values below the base value.
auto operator=(IntegralTexture &&) -> IntegralTexture &=default
auto compute() -> Texture override
Compute the Texture.
auto clampMax() const -> std::uint16_t
The maximum intensity value allowed in neighborhood prior to integration.
void setExponentialDiffBaseValue(double b)
Set the base value for Exponential Difference weighting.
auto exponentialDiffExponent() const -> int
Set the weighting exponent used by Exponential Difference weighting.
void setExponentialDiffSuppressBelowBase(bool b)
When enabled, do not integrate intensity values below the base value.
LinearWeightDirection
Linear weight direction.
void setWeightMethod(WeightMethod w)
Set the weighting method.
void setClampValuesToMax(bool b)
When enabled, clamp neighborhood intensities to the value specified by setClampMax()
auto clampValuesToMax() const -> bool
When enabled, clamp neighborhood intensities to the value specified by setClampMax()
IntegralTexture(IntegralTexture &&)=default
auto linearWeightDirection() const -> LinearWeightDirection
Set the linear weight direction.
auto exponentialDiffBaseMethod() const -> ExpoDiffBaseMethod
Set the method used to calculate the Exponential Difference base value.
auto apply_expodiff_weights_(NDArray< double > &n) const -> NDArray< double >
Texturing and parameterization algorithms and utilities library.
@ Positive
Only consider data in the positive normal direction.
@ Negative
Only consider data in the negative normal direction.