26 #include <ThirdPartyWarningsDisable.h>
28 #include <ThirdPartyWarningsRestore.h>
30 #include <Eigen/Dense>
52 ADDITIONAL_POINT_INNER = 0,
53 ADDITIONAL_POINT_OUTER = 1,
54 ADDITIONAL_POINT_AUTO = 2,
55 ADDITIONAL_POINT_NUM_OPTIONS = 3
61 , useOnlySeedPoints(false)
62 , useSplineApproximationSmoothing(false)
63 , resolveIntersections(true)
64 , additionalPointLocation(ADDITIONAL_POINT_AUTO)
65 , innerPointScale(0.25)
66 , regularizationStrength(0.0)
67 , regularizationStrength2(0.0)
68 , resolveEmbeddedCSOs(false)
69 , supportOpenCSOs(false)
149 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
163 Eigen::ArrayXd _coefficientsHead;
164 Eigen::Array4d _coefficientsTail;
166 unsigned int _numElements;
168 Eigen::Matrix4Xd _positions;
174 StartingPositionsMap _startingPositions;
179 void _computeCoefficientVector();
181 Vector3 _computeInnerPosition(
const std::vector<Vector3>& allPathPointPositions,
const Vector3& planeNormal,
unsigned int j,
bool resolveIntersections,
double& functionValue,
size_t csoLevelOfEmbedding,
CSOPointInPolygonChecker* pointInPolygonChecker=
nullptr);
185 bool _needsHelperCSO()
const;
188 bool _checkSelfIntersection(
const std::vector<Vector3>& allPathPointPositions,
unsigned int predIndex,
unsigned int currIndex)
const;
194 const double sLen = vecarg.dot(vecarg);
196 return sLen * sqrt(sLen);
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Base class for distance functions for application in the marching cubes algorithm.
This class encapsulates the settings for CSOInterpolate3DFunction.
unsigned int maxNumPoints
The maximum number of points used for processing.
double regularizationStrength2
Regularization strength for normal constraints.
bool useOnlySeedPoints
Should only the seed points be used for interpolation?
bool resolveIntersections
If true self intersecting CSOs are handled correctly.
CSOInterpolate3DFunctionSettings()
double innerPointScale
Factor used for determining the inner points.
bool logging
Enables debug logging.
bool useSplineApproximationSmoothing
Should the CSOs be smoothed by a spline approximation (only path points)?
CodePath
Defines the possible code paths.
double regularizationStrength
Regularization strength for surface constraints.
bool supportOpenCSOs
Support for open CSOs.
CodePath codePath
The code path that should be used (FPU or SSE3).
AdditionalPointLocation additionalPointLocation
Defines where the additional points should be located.
unsigned int numThreads
The number of threads used for computation.
bool resolveEmbeddedCSOs
If true embedded CSOs invert their normals.
The CSOInterpolate3DFunction holds the interpolation function which is a smooth thin-plate spline sur...
CSOInterpolate3DFunction()
Constructor.
~CSOInterpolate3DFunction() override
Destructor.
float evaluateAtPos(const Vector3 &pos) const override
Returns a scalar for a given 3D voxel position; can be thought of as evaluating a smoothed distance f...
std::vector< Vector3 > StartingPositions
bool shouldParallelize() const override
Returns whether calls to evaluateAtPos should and can be done from different threads.
CSOInterpolate3DFunction(const CSOList *csoList, const Matrix4 &worldToVoxelMatrix, const Matrix4 &voxelToWorldMatrix, const CSOInterpolate3DFunctionSettings &settings)
Constructor, takes a CSOList and the voxel matrix as arguments.
const CSOInterpolate3DFunctionSettings & getSettings() const
Returns the settings.
StartingPositionsMap & getStartingPositions()
Returns the vector of starting positions for CSOs.
std::map< unsigned int, StartingPositions > StartingPositionsMap
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Checks whether a point is inside a planar, closed polygon in an arbitrary plane.
Tmat4< MLdouble > Matrix4d
A 4x4 matrix of type double.
Tvec4< MLdouble > Vector4d
A vector with 4 components of type double.