ViennaLS
Loading...
Searching...
No Matches
viennals::CompareSparseField< T, D > Class Template Reference

Calculate distance measure between two level sets by comparing their SDF values on a sparse field. This class iterates over the points in the sparse field of the iterated level set and calculates differences with the corresponding values of the expanded level set. More...

#include <lsCompareSparseField.hpp>

Public Member Functions

 CompareSparseField ()
 
 CompareSparseField (SmartPointer< Domain< T, D > > passedLevelSetExpanded, SmartPointer< Domain< T, D > > passedLevelSetIterated)
 
void setLevelSetExpanded (SmartPointer< Domain< T, D > > passedLevelSet)
 
void setLevelSetIterated (SmartPointer< Domain< T, D > > passedLevelSet)
 
void setXRange (T minXRange, T maxXRange)
 Set the x-coordinate range to restrict the comparison area.
 
void setYRange (T minYRange, T maxYRange)
 Set the y-coordinate range to restrict the comparison area.
 
void clearXRange ()
 Clear the x-range restriction.
 
void clearYRange ()
 Clear the y-range restriction.
 
void setOutputMesh (SmartPointer< Mesh< T > > passedMesh)
 Set the output mesh where difference values will be stored.
 
void setFillIteratedWithDistances (bool fill)
 Set whether to fill the iterated level set with distances.
 
void apply ()
 Apply the comparison and calculate the sum of squared differences.
 
T getSumSquaredDifferences () const
 Return the sum of squared differences calculated by apply().
 
T getSumDifferences () const
 Return the sum of differences calculated by apply().
 
unsigned getNumPoints () const
 Return the number of points used in the comparison.
 
unsigned getNumSkippedPoints () const
 Return the number of skipped points during the comparison.
 
T getRMSE () const
 Calculate the root mean square error from previously computed values.
 

Detailed Description

template<class T, int D = 2>
class viennals::CompareSparseField< T, D >

Calculate distance measure between two level sets by comparing their SDF values on a sparse field. This class iterates over the points in the sparse field of the iterated level set and calculates differences with the corresponding values of the expanded level set.

The expanded level set is expected to be expanded in such a way that the sparse field of the iterated level set always overlaps with defined values in the expanded level set. If a level set with a width < 50 is passed as the expaned one, the function will automatically expand it to a width of 50, a value which might be sufficient for many purposes. However, making sure that the level set is sufficiently expanded is the responsibility of the user.

The iterated level set is expected to be sparse. The reduction is performed automatically if this is not the case.

The code is currently intended for 2D level sets only.

Constructor & Destructor Documentation

◆ CompareSparseField() [1/2]

template<class T, int D = 2>
viennals::CompareSparseField< T, D >::CompareSparseField ( )
inline

◆ CompareSparseField() [2/2]

template<class T, int D = 2>
viennals::CompareSparseField< T, D >::CompareSparseField ( SmartPointer< Domain< T, D > > passedLevelSetExpanded,
SmartPointer< Domain< T, D > > passedLevelSetIterated )
inline

Member Function Documentation

◆ apply()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::apply ( )
inline

Apply the comparison and calculate the sum of squared differences.

◆ clearXRange()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::clearXRange ( )
inline

Clear the x-range restriction.

◆ clearYRange()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::clearYRange ( )
inline

Clear the y-range restriction.

◆ getNumPoints()

template<class T, int D = 2>
unsigned viennals::CompareSparseField< T, D >::getNumPoints ( ) const
inline

Return the number of points used in the comparison.

◆ getNumSkippedPoints()

template<class T, int D = 2>
unsigned viennals::CompareSparseField< T, D >::getNumSkippedPoints ( ) const
inline

Return the number of skipped points during the comparison.

◆ getRMSE()

template<class T, int D = 2>
T viennals::CompareSparseField< T, D >::getRMSE ( ) const
inline

Calculate the root mean square error from previously computed values.

◆ getSumDifferences()

template<class T, int D = 2>
T viennals::CompareSparseField< T, D >::getSumDifferences ( ) const
inline

Return the sum of differences calculated by apply().

◆ getSumSquaredDifferences()

template<class T, int D = 2>
T viennals::CompareSparseField< T, D >::getSumSquaredDifferences ( ) const
inline

Return the sum of squared differences calculated by apply().

◆ setFillIteratedWithDistances()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::setFillIteratedWithDistances ( bool fill)
inline

Set whether to fill the iterated level set with distances.

◆ setLevelSetExpanded()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::setLevelSetExpanded ( SmartPointer< Domain< T, D > > passedLevelSet)
inline

◆ setLevelSetIterated()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::setLevelSetIterated ( SmartPointer< Domain< T, D > > passedLevelSet)
inline

◆ setOutputMesh()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::setOutputMesh ( SmartPointer< Mesh< T > > passedMesh)
inline

Set the output mesh where difference values will be stored.

◆ setXRange()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::setXRange ( T minXRange,
T maxXRange )
inline

Set the x-coordinate range to restrict the comparison area.

◆ setYRange()

template<class T, int D = 2>
void viennals::CompareSparseField< T, D >::setYRange ( T minYRange,
T maxYRange )
inline

Set the y-coordinate range to restrict the comparison area.


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