Volume Cartographer 2.27.0
Public Types | Private Member Functions | Private Attributes | List of all members
volcart::texturing::IntegralTexture Class Reference

Generate a Texture by taking the discrete integral (summation) of the neighborhood adjacent to a point. More...

#include <vc/texturing/IntegralTexture.hpp>

Inheritance diagram for volcart::texturing::IntegralTexture:
[legend]
Collaboration diagram for volcart::texturing::IntegralTexture:
[legend]

Public Types

enum class  WeightMethod { None = 0 , Linear , ExpoDiff }
 Weighting Methods. More...
 
enum class  LinearWeightDirection { Positive = 0 , Negative }
 Linear weight direction. More...
 
enum class  ExpoDiffBaseMethod { Mean = 0 , Mode , Manual }
 Exponential difference base calculation method. More...
 
- Public Types inherited from volcart::texturing::TexturingAlgorithm
using Pointer = std::shared_ptr< TexturingAlgorithm >
 
using Texture = std::vector< cv::Mat >
 

Public Member Functions

void setGenerator (NeighborhoodGenerator::Pointer g)
 Set the Neighborhood generator. More...
 
void setClampValuesToMax (bool b)
 When enabled, clamp neighborhood intensities to the value specified by setClampMax() More...
 
auto clampValuesToMax () const -> bool
 When enabled, clamp neighborhood intensities to the value specified by setClampMax() More...
 
void setClampMax (std::uint16_t m)
 The maximum intensity value allowed in neighborhood prior to integration. More...
 
auto clampMax () const -> std::uint16_t
 The maximum intensity value allowed in neighborhood prior to integration. More...
 
void setWeightMethod (WeightMethod w)
 Set the weighting method. More...
 
auto weightMethod () const -> WeightMethod
 Set the weighting method. More...
 
void setLinearWeightDirection (LinearWeightDirection w)
 Set the linear weight direction. More...
 
auto linearWeightDirection () const -> LinearWeightDirection
 Set the linear weight direction. More...
 
void setExponentialDiffExponent (int e)
 Set the weighting exponent used by Exponential Difference weighting.
 
auto exponentialDiffExponent () const -> int
 Set the weighting exponent used by Exponential Difference weighting. More...
 
void setExponentialDiffBaseMethod (ExpoDiffBaseMethod m)
 Set the method used to calculate the Exponential Difference base value. More...
 
auto exponentialDiffBaseMethod () const -> ExpoDiffBaseMethod
 Set the method used to calculate the Exponential Difference base value. More...
 
void setExponentialDiffBaseValue (double b)
 Set the base value for Exponential Difference weighting.
 
auto exponentialDiffBaseValue () const -> double
 Set the base value for Exponential Difference weighting. More...
 
void setExponentialDiffSuppressBelowBase (bool b)
 When enabled, do not integrate intensity values below the base value. More...
 
auto exponentialDiffSuppressBelowBase () const -> bool
 When enabled, do not integrate intensity values below the base value. More...
 
auto compute () -> Texture override
 Compute the Texture. More...
 
- Public Member Functions inherited from volcart::texturing::TexturingAlgorithm
virtual ~TexturingAlgorithm ()=default
 
void setPerPixelMap (PerPixelMap::Pointer ppm)
 Set the input PerPixelMap.
 
void setVolume (Volume::Pointer vol)
 Set the input Volume.
 
virtual auto compute () -> Texture=0
 Compute the Texture. More...
 
auto getTexture () -> Texture
 Get the generated Texture.
 
auto progressIterations () const -> std::size_t override
 Returns the maximum progress value. More...
 
virtual std::size_t progressIterations () const =0
 

Private Member Functions

void setup_weights_ ()
 
auto apply_weights_ (NDArray< double > &n) -> NDArray< double >
 
void setup_linear_weights_ ()
 
auto apply_linear_weights_ (NDArray< double > &n) -> NDArray< double >
 
void setup_expodiff_weights_ ()
 
auto expodiff_intersection_pts_ () -> std::vector< std::uint16_t >
 
auto expodiff_mean_base_ () -> double
 
auto expodiff_mode_base_ () -> double
 
auto apply_expodiff_weights_ (NDArray< double > &n) const -> NDArray< double >
 

Private Attributes

NeighborhoodGenerator::Pointer gen_
 
bool clampToMax_ {false}
 
std::uint16_t clampMax_ {std::numeric_limits<uint16_t>::max()}
 
WeightMethod weight_ {WeightMethod::None}
 
LinearWeightDirection linearWeight_ {LinearWeightDirection::Positive}
 
NDArray< double > linearWeights_ {1}
 
int expoDiffExponent_ {2}
 
ExpoDiffBaseMethod expoDiffBaseMethod_ {ExpoDiffBaseMethod::Mean}
 
double expoDiffManualBase_ {0}
 
double expoDiffBase_ {0}
 
bool suppressBelowBase_ {true}
 
using Pointer = std::shared_ptr< IntegralTexture >
 
static auto New () -> Pointer
 
 IntegralTexture ()=default
 
 ~IntegralTexture () override=default
 
 IntegralTexture (IntegralTexture &)=default
 
 IntegralTexture (IntegralTexture &&)=default
 
auto operator= (const IntegralTexture &) -> IntegralTexture &=default
 
auto operator= (IntegralTexture &&) -> IntegralTexture &=default
 

Additional Inherited Members

- Public Attributes inherited from volcart::IterationsProgress
Signal progressStarted
 
Signal< std::size_t > progressUpdated
 
Signal progressComplete
 
- Protected Member Functions inherited from volcart::texturing::TexturingAlgorithm
 TexturingAlgorithm ()=default
 
 TexturingAlgorithm (TexturingAlgorithm &)=default
 
 TexturingAlgorithm (TexturingAlgorithm &&)=default
 
auto operator= (const TexturingAlgorithm &) -> TexturingAlgorithm &=default
 
auto operator= (TexturingAlgorithm &&) -> TexturingAlgorithm &=default
 
- Protected Attributes inherited from volcart::texturing::TexturingAlgorithm
PerPixelMap::Pointer ppm_
 
Volume::Pointer vol_
 
Texture result_
 

Detailed Description

Generate a Texture by taking the discrete integral (summation) of the neighborhood adjacent to a point.

Definition at line 18 of file IntegralTexture.hpp.

Member Typedef Documentation

◆ Pointer

Pointer type

Definition at line 59 of file IntegralTexture.hpp.

Member Enumeration Documentation

◆ ExpoDiffBaseMethod

Exponential difference base calculation method.

The method by which the base value is calculated for Exponential Difference weighting:

  • Mean: The average intensity value on the surface of the mesh
  • Mode: The most frequent intensity value on the surface of the mesh
  • Manual: The value specified by setExponentialDiffBaseValue()

Definition at line 55 of file IntegralTexture.hpp.

◆ LinearWeightDirection

Linear weight direction.

Setting the weight option applies a linear weight factor to the intensity values of the neighborhood. The options are named according to which values along a point's surface normal are favored.

The weight factors for the options are as follows:

  • Positive: Most Positive: 1.0, Least Positive: 0.0
  • Negative: Most Positive: 0.0, Least Positive: 1.0

Definition at line 44 of file IntegralTexture.hpp.

◆ WeightMethod

Weighting Methods.

The method by which neighborhoods are weighted prior to integration:

  • None: No weighting is performed.
  • Linear: Values are linearly weighted based on their position in the neighborhood. See LinearWeightDirection for more details.
  • ExpoDiff: Intensity values are exponentially weighted based on their difference from a base intensity value.

Definition at line 31 of file IntegralTexture.hpp.

Constructor & Destructor Documentation

◆ IntegralTexture() [1/3]

volcart::texturing::IntegralTexture::IntegralTexture ( )
default

Default constructor

◆ ~IntegralTexture()

volcart::texturing::IntegralTexture::~IntegralTexture ( )
overridedefault

Default destructor

◆ IntegralTexture() [2/3]

volcart::texturing::IntegralTexture::IntegralTexture ( IntegralTexture )
default

Default copy constructor

◆ IntegralTexture() [3/3]

volcart::texturing::IntegralTexture::IntegralTexture ( IntegralTexture &&  )
default

Default move constructor

Member Function Documentation

◆ apply_expodiff_weights_()

auto volcart::texturing::IntegralTexture::apply_expodiff_weights_ ( NDArray< double > &  n) const -> NDArray< double >
private

Apply the expo diff weights to a neighborhood

◆ apply_linear_weights_()

auto volcart::texturing::IntegralTexture::apply_linear_weights_ ( NDArray< double > &  n) -> NDArray< double >
private

Apply the linear weights vector to a neighborhood

◆ apply_weights_()

auto volcart::texturing::IntegralTexture::apply_weights_ ( NDArray< double > &  n) -> NDArray< double >
private

Apply the selected weighting method

◆ clampMax()

auto volcart::texturing::IntegralTexture::clampMax ( ) const -> std::uint16_t

The maximum intensity value allowed in neighborhood prior to integration.

Ignored if setClampValuesToMax() is set to false

Default: std::numeric_limits<std::uint16_t>::max()

◆ clampValuesToMax()

auto volcart::texturing::IntegralTexture::clampValuesToMax ( ) const -> bool

When enabled, clamp neighborhood intensities to the value specified by setClampMax()

Note: Clamping is performed prior to integration of the neighborhood

◆ compute()

auto volcart::texturing::IntegralTexture::compute ( ) -> Texture
overridevirtual

Compute the Texture.

Implements volcart::texturing::TexturingAlgorithm.

◆ expodiff_intersection_pts_()

auto volcart::texturing::IntegralTexture::expodiff_intersection_pts_ ( ) -> std::vector< std::uint16_t >
private

Get the list of intensities on the surface of the mesh

◆ expodiff_mean_base_()

auto volcart::texturing::IntegralTexture::expodiff_mean_base_ ( ) -> double
private

Calculate the mean base value

◆ expodiff_mode_base_()

auto volcart::texturing::IntegralTexture::expodiff_mode_base_ ( ) -> double
private

Calculate the mode base value

◆ exponentialDiffBaseMethod()

auto volcart::texturing::IntegralTexture::exponentialDiffBaseMethod ( ) const -> ExpoDiffBaseMethod

Set the method used to calculate the Exponential Difference base value.

Default: Mean

◆ exponentialDiffBaseValue()

auto volcart::texturing::IntegralTexture::exponentialDiffBaseValue ( ) const -> double

Set the base value for Exponential Difference weighting.

◆ exponentialDiffExponent()

auto volcart::texturing::IntegralTexture::exponentialDiffExponent ( ) const -> int

Set the weighting exponent used by Exponential Difference weighting.

◆ exponentialDiffSuppressBelowBase()

auto volcart::texturing::IntegralTexture::exponentialDiffSuppressBelowBase ( ) const -> bool

When enabled, do not integrate intensity values below the base value.

For exponential difference weighting only.

Default: True

◆ linearWeightDirection()

auto volcart::texturing::IntegralTexture::linearWeightDirection ( ) const -> LinearWeightDirection

Set the linear weight direction.

Default: Positive

◆ New()

static auto volcart::texturing::IntegralTexture::New ( ) -> Pointer
static

Make shared pointer

◆ operator=() [1/2]

auto volcart::texturing::IntegralTexture::operator= ( const IntegralTexture ) -> IntegralTexture &=default
default

Default copy operator

◆ operator=() [2/2]

auto volcart::texturing::IntegralTexture::operator= ( IntegralTexture &&  ) -> IntegralTexture &=default
default

Default move operator

◆ setClampMax()

void volcart::texturing::IntegralTexture::setClampMax ( std::uint16_t  m)

The maximum intensity value allowed in neighborhood prior to integration.

Ignored if setClampValuesToMax() is set to false

Default: std::numeric_limits<std::uint16_t>::max()

◆ setClampValuesToMax()

void volcart::texturing::IntegralTexture::setClampValuesToMax ( bool  b)

When enabled, clamp neighborhood intensities to the value specified by setClampMax()

Note: Clamping is performed prior to integration of the neighborhood

◆ setExponentialDiffBaseMethod()

void volcart::texturing::IntegralTexture::setExponentialDiffBaseMethod ( ExpoDiffBaseMethod  m)

Set the method used to calculate the Exponential Difference base value.

Default: Mean

◆ setExponentialDiffSuppressBelowBase()

void volcart::texturing::IntegralTexture::setExponentialDiffSuppressBelowBase ( bool  b)

When enabled, do not integrate intensity values below the base value.

For exponential difference weighting only.

Default: True

◆ setGenerator()

void volcart::texturing::IntegralTexture::setGenerator ( NeighborhoodGenerator::Pointer  g)

Set the Neighborhood generator.

This class supports generators of dimension >= 1

◆ setLinearWeightDirection()

void volcart::texturing::IntegralTexture::setLinearWeightDirection ( LinearWeightDirection  w)

Set the linear weight direction.

Default: Positive

◆ setup_expodiff_weights_()

void volcart::texturing::IntegralTexture::setup_expodiff_weights_ ( )
private

Setup the expo diff weights

◆ setup_linear_weights_()

void volcart::texturing::IntegralTexture::setup_linear_weights_ ( )
private

Setup the linear weights vector

◆ setup_weights_()

void volcart::texturing::IntegralTexture::setup_weights_ ( )
private

Setup the selected weighting method

◆ setWeightMethod()

void volcart::texturing::IntegralTexture::setWeightMethod ( WeightMethod  w)

Set the weighting method.

Default: None

◆ weightMethod()

auto volcart::texturing::IntegralTexture::weightMethod ( ) const -> WeightMethod

Set the weighting method.

Default: None

Member Data Documentation

◆ clampMax_

std::uint16_t volcart::texturing::IntegralTexture::clampMax_ {std::numeric_limits<uint16_t>::max()}
private

Maximum allowed value in neighborhood when clamping is enabled

Definition at line 183 of file IntegralTexture.hpp.

◆ clampToMax_

bool volcart::texturing::IntegralTexture::clampToMax_ {false}
private

Enable/Disable clamping to maximum value

Definition at line 180 of file IntegralTexture.hpp.

◆ expoDiffBase_

double volcart::texturing::IntegralTexture::expoDiffBase_ {0}
private

Exponential diff base value that is used

Definition at line 216 of file IntegralTexture.hpp.

◆ expoDiffBaseMethod_

ExpoDiffBaseMethod volcart::texturing::IntegralTexture::expoDiffBaseMethod_ {ExpoDiffBaseMethod::Mean}
private

Exponential diff base calculation method

Definition at line 210 of file IntegralTexture.hpp.

◆ expoDiffExponent_

int volcart::texturing::IntegralTexture::expoDiffExponent_ {2}
private

Exponential diff exponent

Definition at line 207 of file IntegralTexture.hpp.

◆ expoDiffManualBase_

double volcart::texturing::IntegralTexture::expoDiffManualBase_ {0}
private

Manually specified exponential diff base

Definition at line 213 of file IntegralTexture.hpp.

◆ gen_

NeighborhoodGenerator::Pointer volcart::texturing::IntegralTexture::gen_
private

Neighborhood generator

Definition at line 177 of file IntegralTexture.hpp.

◆ linearWeight_

LinearWeightDirection volcart::texturing::IntegralTexture::linearWeight_ {LinearWeightDirection::Positive}
private

Linear weighting direction

Definition at line 195 of file IntegralTexture.hpp.

◆ linearWeights_

NDArray<double> volcart::texturing::IntegralTexture::linearWeights_ {1}
private

Linear weights vector

Definition at line 198 of file IntegralTexture.hpp.

◆ suppressBelowBase_

bool volcart::texturing::IntegralTexture::suppressBelowBase_ {true}
private

Whether or not to ignore values below the base value

Definition at line 219 of file IntegralTexture.hpp.

◆ weight_

WeightMethod volcart::texturing::IntegralTexture::weight_ {WeightMethod::None}
private

Selected Weighting method

Definition at line 186 of file IntegralTexture.hpp.


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