ImageDev

- Getting Started
- ImageDev Python
- ImageDev C#
- ImageDev C++
- Licensing Information
- Redistributable Files
- Processing
- Image Manipulation
- - Synthetic Images
  - - RandomImage2d
    - RandomImage3d
    - RandomGaussianImage2d
    - RandomGaussianImage3d
    - RadialFunctionImage2d
    - RadialFunctionImage3d
    - OrientedLinesImage2d
    - OrientedLinesImage3d
    - RandomSphereImage3d
    - BoxGridImage2d
    - BoxGridImage3d
    - WedgeMaskImage3d
    - PointSpreadFunctionImage3d
  - Image Editing
  - - ConvertImage
    - ResetImage
    - CopyImage
    - PasteImage2d
    - PasteImage3d
    - CropImage2d
    - CropImage3d
    - SampleImage2d
    - SampleImage3d
    - InterlaceFrames2d
    - DeinterlaceFrames2d
  - Stack Operations
  - - SequenceConcatenation
    - SequenceToMultispectral
    - SequenceToVolume
    - VolumeToSequence
    - MultispectralToSequence
    - GetSliceFromVolume3d
    - SetSliceToVolume3d
    - GetObliqueSliceFromVolume3d
    - ImageStackProjection3d
    - VolumeProjection3d
- Geometry And Matching
- - Geometric Transforms
  - - Shearing3d
    - TranslateImage2d
    - TranslateImage3d
    - Flip2d
    - Flip3d
    - FlipImage2d
    - FlipImage3d
    - TransposeImage2d
    - TransposeImage3d
    - SwapQuadrants
    - Rotate2d
    - Rotate3d
    - RotationGenerator3d
    - Resize2d
    - Resize3d
    - RescaleByFactor
    - RescaleImageByFactor
    - ResampleAffine2d
    - ResampleAffine3d
    - ResampleElastic2d
    - SurfaceUnfolding3d
  - Pattern Recognition
  - - BinaryCorrelation2d
    - CrossCorrelation2d
    - CorrelationByDifference2d
    - CorrelationBySignChange2d
  - Registration
  - - ImagePrealignment3d
    - AffineRegistration
    - ElasticRegistration2d
- Arithmetic And Logic
- - Arithmetical Operations
  - - AbsoluteValue
    - AbsoluteMaximumWithImage
    - ArithmeticOperationWithImage
    - ArithmeticOperationWithValue
    - BlendWithImage
    - BlendWithValue
    - DirectionalBlending2d
    - CombineByMask
    - ImageFormula
    - EigenDecomposition2d
    - EigenDecomposition3d
  - Logical Operations
  - - MaskImage
    - LogicalOperationWithImage
    - LogicalOperationWithValue
    - LogicalNot
    - InvertImage
    - BitShift
- Image Filtering
- - Grayscale Transforms
  - - RescaleIntensity
    - StackRescaleIntensity
    - MatchContrast
    - HistogramEqualization
    - Clahe2d
    - Clahe3d
    - AdaptiveHistogramEqualization
    - ApplyGrayscaleLut
    - BackgroundImage2d
    - RadialBackgroundImage2d
    - ShadingCorrection
    - Exponential
    - Logarithm
    - Square
    - SquareRoot
    - RingArtifactRemoval3d
    - BeamHardeningCorrection3d
  - Color Transforms
  - - ColorToLightness
    - GetColorChannel
    - ColorToGrayscale
    - GrayscaleToColor
    - ColorSpaceConversion
    - ColorAntialiasing2d
    - BayerToRgb2d
    - DecorrelationStretch2d
    - BlendAlphaChannelWithImage
    - BlendAlphaChannelWithValue
  - Smoothing And Denoising
  - - BoxFilter2d
    - BoxFilter3d
    - MedianFilter2d
    - MedianFilter3d
    - GaussianFilter2d
    - GaussianFilter3d
    - ExponentialFilter2d
    - RecursiveExponentialFilter2d
    - RecursiveExponentialFilter3d
    - NonLocalMeansFilter2d
    - NonLocalMeansFilter3d
    - CurvatureDrivenDiffusion
    - BilateralFilter2d
    - BilateralFilter3d
    - MajorityFilter2d
    - MajorityFilter3d
    - SigmaFilter2d
    - SigmaFilter3d
    - Despeckle2d
    - Despeckle3d
    - NagaoFilter2d
    - NagaoFilter3d
    - SnnFilter2d
    - SnnFilter3d
    - FlowInpainting
  - Sharpening
  - - Deblurring2d
    - Delineate2d
    - Delineate3d
    - UnsharpMasking2d
    - UnsharpMasking3d
    - Shade2d
    - RichardsonLucyDeconvolution
  - Texture Filters
  - - MeanFilter2d
    - MeanFilter3d
    - VarianceFilter2d
    - VarianceFilter3d
    - SkewnessFilter2d
    - SkewnessFilter3d
    - KurtosisFilter2d
    - KurtosisFilter3d
    - ContrastFilter2d
    - ContrastFilter3d
    - VariationFilter2d
    - VariationFilter3d
    - EnergyFilter2d
    - EnergyFilter3d
    - EntropyFilter2d
    - EntropyFilter3d
    - AutocorrelationFilter
    - LocalAutocorrelationFilter2d
    - ImageCurvature2d
    - ImageCurvature3d
    - StructureEnhancementFilter2d
    - StructureEnhancementFilter3d
    - ScaleSpaceLogFilter2d
    - ScaleSpaceLogFilter3d
  - Frequency Domain
  - - ComplexFft
    - ComplexFftInverse
    - ComplexCenteredFft
    - ComplexCenteredFftInverse
    - CartesianToPolar2d
    - PolarToCartesian2d
    - ConvolutionWithImage
    - ConvolutionWithImage2d
    - RadialFrequencyFilter2d
    - GaborFiltering2d
- Edge Detection
- - Gradient
  - - GradientOperator2d
    - GradientOperator3d
    - VectorToMagnitude2d
    - VectorToMagnitude3d
    - GradientVector2d
    - GradientVector3d
    - GradientMagnitude2d
    - GradientMagnitude3d
    - MorphologicalGradient2d
    - MorphologicalGradient3d
    - RadialGradientCentered2d
    - RadialGradientCentered3d
    - RadialGradientContour2d
    - RadialGradientContour3d
    - RadialGradientLabel2d
    - RadialGradientLabel3d
  - Laplacian
  - - DobFilter2d
    - DobFilter3d
    - MorphologicalLaplacian
    - RecursiveLaplacian2d
    - RecursiveLaplacian3d
  - Other Derivatives
  - - GaussianDerivative2d
    - GaussianDerivative3d
    - GaussianHessianMatrix2d
    - GaussianHessianMatrix3d
    - GaussianGradientTensor2d
    - GaussianGradientTensor3d
  - Edge Marking
  - - ImageLocalMaxima2d
    - ImageLocalMaxima3d
    - RidgeDetection
    - ZeroCrossings2d
    - DijkstraShortestPath2d
    - EigenvaluesToStructureness2d
    - EigenvaluesToStructureness3d
    - TensorVoting2d
    - CannyEdgeDetector2d
    - CannyEdgeDetector3d
- Image Segmentation
- - Binarization
  - - Thresholding
    - ThresholdingByCriterion
    - AutoThresholdingBright
    - AutoThresholdingDark
    - ColorThresholding
    - TopHat
    - FeatureAdaptiveThresholding
    - AdaptiveThresholding2d
    - AdaptiveThresholding3d
    - HysteresisThresholding
  - Labeling
  - - Labeling2d
    - Labeling3d
    - ReorderLabels
    - AssignLabel
    - AddObjectToLabel
    - GroupCloseLabelsl2d
  - Feature Selection
  - - KillBorder2d
    - KillBorder3d
    - RemoveSmallSpots
    - ObjectBoundaries
    - BinarySmoothing2d
    - BinarySmoothing3d
    - LabelInterfaces
  - Separating And Filling
  - - FillHoles2d
    - FillHoles3d
    - RemoveSmallHoles
    - FillImageBorder3d
    - ExpandLabelBoundaries
    - SeparateObjects
    - HExtremaWatershed
    - SeparateObjectsByBlock
    - HExtremaWatershedByBlock
    - ConvexHull2d
  - Region Growing
  - - MarkerBasedWatershed2d
    - MarkerBasedWatershed3d
    - MarkerBasedWatershedByBlock
    - MarkerBasedWatershedBasinsByBlock
    - ExpandLabelsOnBackground
    - FloodFillThreshold2d
    - FloodFillThreshold3d
    - Waterpixel
  - Computational Geometry
  - - PolylineResampler2d
    - PolylineResampler3d
    - PolylineExtrusion3d
    - SurfaceFitting3d
- Mathematical Morphology
- - Erosion And Dilation
  - - Erosion2d
    - Erosion3d
    - Dilation2d
    - Dilation3d
    - ErosionDisk2d
    - ErosionDisk3d
    - ErosionBall3d
    - DilationDisk2d
    - DilationDisk3d
    - DilationBall3d
    - ErosionLine2d
    - ErosionLine3d
    - DilationLine2d
    - DilationLine3d
    - ErosionColor2d
    - DilationColor2d
    - SelectiveErosion2d
    - SelectiveErosion3d
    - SelectiveDilation2d
    - SelectiveDilation3d
  - Opening And Closing
  - - Opening2d
    - Opening3d
    - Closing2d
    - Closing3d
    - OpeningDisk2d
    - OpeningDisk3d
    - OpeningBall3d
    - ClosingDisk2d
    - ClosingDisk3d
    - ClosingBall3d
    - OpeningLine2d
    - OpeningLine3d
    - ClosingLine2d
    - ClosingLine3d
    - OpeningLineMaximum
    - ClosingLineMinimum
    - OpeningColor2d
    - ClosingColor2d
    - OpeningByReconstruction2d
    - OpeningByReconstruction3d
    - ClosingByReconstruction2d
    - ClosingByReconstruction3d
    - OpeningDiskByReconstruction2d
    - OpeningBallByReconstruction3d
    - ClosingDiskByReconstruction2d
    - ClosingBallByReconstruction3d
    - SelectiveOpening2d
    - SelectiveOpening3d
    - SelectiveClosing2d
    - SelectiveClosing3d
  - Hit Or Miss And Skeleton
  - - Skeleton
    - Centerline3d
    - InfluenceZones
    - Centroid2d
    - EndPoints2d
    - EndPoints3d
    - Pruning2d
    - Pruning3d
    - IsolatedPoints2d
    - IsolatedPoints3d
    - TriplePoints2d
    - InteriorPoints2d
    - ApplyMorphologicalLut2d
    - ApplyMorphologicalLut3d
  - Geodesic Transformations
  - - ReconstructionFromMarkers2d
    - ReconstructionFromMarkers3d
    - GrayscaleReconstruction2d
    - GrayscaleReconstruction3d
    - GrayscaleFillHoles2d
    - GrayscaleFillHoles3d
    - HExtrema2d
    - HExtrema3d
    - RegionalExtrema2d
    - RegionalExtrema3d
    - UltimateErosion
  - Distance Maps
  - - DistanceMap2d
    - DistanceMap3d
    - EuclideanDistanceMap3d
    - EuclideanDistanceMap2d
    - GeodesicDistanceMap
    - ClosestBoundaryPoints2d
    - ClosestBoundaryPoints3d
    - TimeMap
    - LocalThicknessMap3d
    - GeodesicPropagation2d
    - GeodesicMaxima
    - GeodesicMinima
- Image Analysis
- - Image Measurements
  - - BinaryAnalysis
    - Area2d
    - Area3d
    - IntensityIntegral2d
    - IntensityIntegral3d
    - ObjectCount
    - DistanceMean2d
    - EulerNumber2d
    - EulerNumber3d
    - FractalDimension
    - CurvatureIntegrals3d
  - Image Statistics
  - - IntensityExtrema
    - IntensityStatistics
    - IntensityMaskedStatistics
    - IntensityHistogram
    - IntensityBinHistogram
    - AutoThresholdingValue
    - CompareImage
    - CompareValue
    - SimilarityMetricValue
    - SsimValue2d
    - SsimValue3d
    - RegionSimilarity
    - RadialIntensityProfile2d
    - RadialIntensityProfile3d
    - CylindricalIntensityProfile3d
    - RadialAutocorrelationProfile
    - Cooccurrence2d
    - MeasureGaussianNoise
    - LocalMaxima2d
    - LocalMaxima3d
    - PeakExtractor
    - LocalDensityMap2d
    - LocalDensityMap3d
    - SegmentationMetrics
  - Individual Measurements
  - - VolumeFractionByLabel
    - LabelCountByRegion
    - VolumeFractionByRegion
    - LabelAnalysis
    - LabelFiltering
    - LabelFilteringAnalysis
    - FilterAnalysis
    - MeasurementToImage
    - FilterByMeasurement
    - SieveLabeling
  - Moments And Orientations
  - - MomentsOfInertia2d
    - MomentsOfInertia3d
    - InertiaMoment2d
    - Eccentricity2d
    - OrientationMapFourier3d
    - OrientationMatchingFourier3d
  - Morphometry
  - - ObjectVolume
    - TotalImageVolume
    - ObjectBoundaryArea
    - TotalImageBoundaryArea
    - AverageObjectAreaPerSlice3d
    - AverageObjectCountPerSlice3d
    - ObjectImageRatio
    - ObjectSpecificSurface
    - ObjectSurfaceDensity
    - PorosityPercentage3d
    - FragmentationIndex
    - StructureModelIndex3d
    - AverageObjectThickness3d
    - AverageSpaceThickness3d
    - ObjectLinearDensity3d
    - DegreeOfAnisotropy
  - Propagation
  - - AxisPropagationBinary3d
    - AxisPropagationBinaryWithSeeds3d
    - AxisPropagationLabel3d
    - AxisPropagationLabelWithSeeds3d
    - AxisPropagationDistance3d
    - EstimateShortestPath3d
    - PercolationThreshold3d
    - AxisConnectivity3d
    - CentroidPathTortuosity3d
- Machine Learning
- - Classification
  - - AutoSegmentation3Phases
    - AutoIntensityClassification
    - SupervisedTextureClassification2d
    - SupervisedTextureClassification3d
    - TextureClassificationCreate
    - TextureClassificationTrain
    - TextureClassificationApply
  - Deep learning
  - - OnnxPredictionFiltering2d
    - OnnxPredictionFiltering3d
    - OnnxPredictionSegmentation2d
    - OnnxPredictionSegmentation3d
    - OnnxPredictionTwoOutputs2d
    - OnnxPredictionTwoOutputs3d
- Business Application
- - Dental
  - - DentalWallSegmentation3d
    - DentalMeshExtraction3d
    - DentalUnfolding3d
- IO
- - Image Data
  - - ReadVipImage
    - WriteVipImage
  - Algebraic Data
  - - ReadArrayXd
    - ReadArrayXi64
    - WriteArrayXd
    - WriteArrayXi64
  - Model
  - - ReadOnnxModel
- CUDA
- - Geometry And Matching
  - - CudaCrossCorrelation2d
    - CudaTemplateMatching3d
  - Image Filtering
  - - CudaBoxFilter2d
    - CudaMedianFilter2d
    - CudaGaussianFilter3d
    - CudaAdaptiveManifoldNlmFilter
  - Mathematical Morphology
  - - CudaErosion2d
    - CudaDilation2d
    - CudaOpening2d
    - CudaClosing2d
- Utilities
- Initialization
- Processing
- Syntax Check
- Visualization
- Data Object
- Image Data
- Kernels
- - MorphologicalKernel2d
  - MorphologicalKernel3d
  - MorphologicalLut2d
  - MorphologicalLut3d
- Model
- - TextureClassificationModel
  - OnnxModel
- Global Measurements
- - Image Measurements
  - - Area2dMsr
    - Area3dMsr
    - IntensityIntegral2dMsr
    - IntensityIntegral3dMsr
    - ObjectCountMsr
    - DistanceMeanMsr
    - Euler2dMsr
    - Euler3dMsr
    - FractalMsr
    - CurvatureIntegralsMsr
  - Image Statistics
  - - IntensityExtremaMsr
    - StatisticsMsr
    - IntensityHistogramMsr
    - IntensityBinHistogramMsr
    - CompareMsr
    - SimilarityMetricValueMsr
    - SsimValueMsr
    - RegionSimilarityMsr
    - SegmentationMetricsObjectMsr
    - SegmentationMetricsImageMsr
    - CylindricalIntensityProfileMsr
    - RadialIntensityProfileMsr
    - CorrelationMsr
    - CoocurrrenceMsr
    - GaussianNoiseMsr
    - LocalMaximaMsr
    - PeakExtractorMsr
  - Individual Measurements
  - - VolumeFractionByLabelMsr
    - LabelCountByRegionMsr
    - VolumeFractionByRegionMsr
  - Moments And Orientations
  - - MomentsOfInertia2dMsr
    - MomentsOfInertia3dMsr
    - MeanInertiaMomentMsr
    - Eccentricity2dMsr
    - LocalOrientation3dMsr
  - Morphometry
  - - ObjectVolumeMsr
    - ImageVolumeMsr
    - ObjectBoundaryAreaMsr
    - ImageBoundaryAreaMsr
    - AverageObjectAreaPerSliceMsr
    - AverageObjectCountPerSliceMsr
    - ObjectImageRatioMsr
    - ObjectSpecificSurfaceMsr
    - ObjectSurfaceDensityMsr
    - PorosityPercentageMsr
    - FragmentationMsr
    - StructureModelIndexMsr
    - AverageObjectThicknessMsr
    - AverageSpaceThicknessMsr
    - ObjectLinearDensityMsr
    - AnisotropyDegreeMsr
  - Propagation
  - - AxisPropagationBinary3dMsr
    - AxisPropagationLabel3dMsr
    - AxisPropagationDistance3dMsr
    - PercolationThreshold3dMsr
    - CentroidTortuosity3dMsr
  - Geometry And Matching
  - - CrossCorrelation2dMsr
  - Edge Detection
  - - CannyEdgeDetectorMsr
  - Image Segmentation
  - - AutoThresholdingMsr
    - AutoSegmentation3PhasesMsr
  - Mathematical Morphology
  - - ApplyMorphologicalLutMsr
- Analysis Measurements
- - AnalysisMsr
  - Measurement
  - Native Measurements
  - - Geometry
    - Feret
    - Intensity
    - Histogram
    - Inertia
    - Locate
    - Segment
    - Cooccurrence
  - CustomMeasurement
  - MeasurementAttributes
  - - Quantile
    - Histogram
    - Feret2d
    - Feret3d
    - NeighborCount
    - Cooccurrence
    - Breadth3d
  - MeasurementGroup
- Measurement Information
- - FieldInformation
  - CustomMeasurementInfo
- CUDA
- - CudaContext
- User Guide
- First Steps
- - Hello ImageDev
  - Initialize ImageDev
- Image Management
- - Create 2D Image
  - Create 3D Image
  - Data Transfer
- Standard Processing
- - Denoising
  - Thresholding
- Image Analysis
- - Global Analysis
  - Label Analysis
  - Measurement Browsing
  - Measurement Group
  - Custom Analysis
- Advanced Processing
- - Algorithm Tracking
- Typical Use Cases
- - Particle Analysis
  - Pore Analysis

# SurfaceFitting3d

Adjusts the positions of the vertices of a structured quadrilateral mesh according to weights provided by a volume.
Access to parameter description
The weights given by the input volume intensities characterize the features or structures on which the input surface must be fitted. For instance, weights can be the distance to a wall to approximate.
This algorithm searches for a best fit along a direction specified for each vertex up to a distance defined by the distance parameter.
A voxel is considered as a best fit based on a criterion given by the fittingCriterion parameter.
A regularization can be applied on the resulting surface to smooth it and limit the effect of outliers.
See also

- PolylineResampler3d
- SurfaceUnfolding3d
- PolylineExtrusion3d
- DentalMeshExtraction3d

##
Function Syntax

This function returns outputSurface.

    // Function prototype
    std::shared_ptr<iolink::ArrayXd>
    surfaceFitting3d( std::shared_ptr< iolink::ImageView > inputIntensityImage,
                      std::shared_ptr<iolink::ArrayXd> inputSurface,
                      std::shared_ptr<iolink::ArrayXd> directions,
                      double distance,
                      const iolink::Vector2d& thresholdRange,
                      double smoothing,
                      SurfaceFitting3d::FittingCriterion fittingCriterion,
                      SurfaceFitting3d::BoundaryCondition topBoundaryCondition,
                      SurfaceFitting3d::BoundaryCondition bottomBoundaryCondition,
                      SurfaceFitting3d::BoundaryCondition leftBoundaryCondition,
                      SurfaceFitting3d::BoundaryCondition rightBoundaryCondition,
                      SurfaceFitting3d::RegularizationType regularizationType,
                      const iolink::Vector4d& dirichletValues,
                      std::shared_ptr<iolink::ArrayXd> outputSurface = nullptr );

This function returns outputSurface.

    // Function prototype.
    surface_fitting_3d(input_intensity_image: idt.ImageType,
                       input_surface: Union[idt.NDArrayFloat, None],
                       directions: Union[idt.NDArrayFloat, None],
                       distance: float = 1,
                       threshold_range: Union[Iterable[int], Iterable[float]] = [0, 1.7976931348623157e+308],
                       smoothing: float = 1,
                       fitting_criterion: SurfaceFitting3d.FittingCriterion = SurfaceFitting3d.FittingCriterion.MAXIMUM,
                       top_boundary_condition: SurfaceFitting3d.BoundaryCondition = SurfaceFitting3d.BoundaryCondition.NEUMANN,
                       bottom_boundary_condition: SurfaceFitting3d.BoundaryCondition = SurfaceFitting3d.BoundaryCondition.NEUMANN,
                       left_boundary_condition: SurfaceFitting3d.BoundaryCondition = SurfaceFitting3d.BoundaryCondition.NEUMANN,
                       right_boundary_condition: SurfaceFitting3d.BoundaryCondition = SurfaceFitting3d.BoundaryCondition.NEUMANN,
                       regularization_type: SurfaceFitting3d.RegularizationType = SurfaceFitting3d.RegularizationType.LAPLACIAN,
                       dirichlet_values: Union[Iterable[int], Iterable[float]] = [0, 0, 0, 0],
                       output_surface: Union[idt.NDArrayFloat, None] = None) -> Union[idt.NDArrayFloat, None]

This function returns outputSurface.

    // Function prototype.
    public static IOLink.ArrayXd
    SurfaceFitting3d( IOLink.ImageView inputIntensityImage,
                      IOLink.ArrayXd inputSurface,
                      IOLink.ArrayXd directions,
                      double distance = 1,
                      double[] thresholdRange = null,
                      double smoothing = 1,
                      SurfaceFitting3d.FittingCriterion fittingCriterion = ImageDev.SurfaceFitting3d.FittingCriterion.MAXIMUM,
                      SurfaceFitting3d.BoundaryCondition topBoundaryCondition = ImageDev.SurfaceFitting3d.BoundaryCondition.NEUMANN,
                      SurfaceFitting3d.BoundaryCondition bottomBoundaryCondition = ImageDev.SurfaceFitting3d.BoundaryCondition.NEUMANN,
                      SurfaceFitting3d.BoundaryCondition leftBoundaryCondition = ImageDev.SurfaceFitting3d.BoundaryCondition.NEUMANN,
                      SurfaceFitting3d.BoundaryCondition rightBoundaryCondition = ImageDev.SurfaceFitting3d.BoundaryCondition.NEUMANN,
                      SurfaceFitting3d.RegularizationType regularizationType = ImageDev.SurfaceFitting3d.RegularizationType.LAPLACIAN,
                      double[] dirichletValues = null,
                      IOLink.ArrayXd outputSurface = null );

##
Class Syntax

    // Command constructor.
    SurfaceFitting3d();

    /// Gets the inputIntensityImage parameter.
    /// The 3D input image containing the weight values to consider for the fitting.
    std::shared_ptr< iolink::ImageView > inputIntensityImage() const;
    /// Sets the inputIntensityImage parameter.
    /// The 3D input image containing the weight values to consider for the fitting.
    void setInputIntensityImage( std::shared_ptr< iolink::ImageView > inputIntensityImage );

    /// Gets the inputSurface parameter.
    /// The input mesh that represents the surface to fit. This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
    std::shared_ptr<iolink::ArrayXd> inputSurface() const;
    /// Sets the inputSurface parameter.
    /// The input mesh that represents the surface to fit. This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
    void setInputSurface( std::shared_ptr<iolink::ArrayXd> inputSurface );

    /// Gets the directions parameter.
    /// The search direction for each vertex.
    std::shared_ptr<iolink::ArrayXd> directions() const;
    /// Sets the directions parameter.
    /// The search direction for each vertex.
    void setDirections( std::shared_ptr<iolink::ArrayXd> directions );

    /// Gets the distance parameter.
    /// The maximum distance to which the vertices can be moved.
    double distance() const;
    /// Sets the distance parameter.
    /// The maximum distance to which the vertices can be moved.
    void setDistance( const double& distance );

    /// Gets the thresholdRange parameter.
    /// The range of values that can be considered for the best fit.
    iolink::Vector2d thresholdRange() const;
    /// Sets the thresholdRange parameter.
    /// The range of values that can be considered for the best fit.
    void setThresholdRange( const iolink::Vector2d& thresholdRange );

    /// Gets the smoothing parameter.
    /// The strength of the regularization applied on the fitted mesh.
    double smoothing() const;
    /// Sets the smoothing parameter.
    /// The strength of the regularization applied on the fitted mesh.
    void setSmoothing( const double& smoothing );

    /// Gets the fittingCriterion parameter.
    /// The criterion according to which a vertex can be kept as the best fit.
    SurfaceFitting3d::FittingCriterion fittingCriterion() const;
    /// Sets the fittingCriterion parameter.
    /// The criterion according to which a vertex can be kept as the best fit.
    void setFittingCriterion( const SurfaceFitting3d::FittingCriterion& fittingCriterion );

    /// Gets the topBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the top of the mesh.
    SurfaceFitting3d::BoundaryCondition topBoundaryCondition() const;
    /// Sets the topBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the top of the mesh.
    void setTopBoundaryCondition( const SurfaceFitting3d::BoundaryCondition& topBoundaryCondition );

    /// Gets the bottomBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the bottom of the mesh.
    SurfaceFitting3d::BoundaryCondition bottomBoundaryCondition() const;
    /// Sets the bottomBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the bottom of the mesh.
    void setBottomBoundaryCondition( const SurfaceFitting3d::BoundaryCondition& bottomBoundaryCondition );

    /// Gets the leftBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the left of the mesh.
    SurfaceFitting3d::BoundaryCondition leftBoundaryCondition() const;
    /// Sets the leftBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the left of the mesh.
    void setLeftBoundaryCondition( const SurfaceFitting3d::BoundaryCondition& leftBoundaryCondition );

    /// Gets the rightBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the right of the mesh.
    SurfaceFitting3d::BoundaryCondition rightBoundaryCondition() const;
    /// Sets the rightBoundaryCondition parameter.
    /// The type of boundary conditions to apply on the right of the mesh.
    void setRightBoundaryCondition( const SurfaceFitting3d::BoundaryCondition& rightBoundaryCondition );

    /// Gets the regularizationType parameter.
    /// The type of regularization used to smooth the mesh.
    SurfaceFitting3d::RegularizationType regularizationType() const;
    /// Sets the regularizationType parameter.
    /// The type of regularization used to smooth the mesh.
    void setRegularizationType( const SurfaceFitting3d::RegularizationType& regularizationType );

    /// Gets the dirichletValues parameter.
    /// The Dirichlet values for the left, right, top, and bottom boundary conditions. If set to 0, the vertices are not moved on the borders for which the Dirichlet conditions are enabled. This value is ignored when the Neumann boundary conditions are enabled for the corresponding mesh border.
    iolink::Vector4d dirichletValues() const;
    /// Sets the dirichletValues parameter.
    /// The Dirichlet values for the left, right, top, and bottom boundary conditions. If set to 0, the vertices are not moved on the borders for which the Dirichlet conditions are enabled. This value is ignored when the Neumann boundary conditions are enabled for the corresponding mesh border.
    void setDirichletValues( const iolink::Vector4d& dirichletValues );

    /// Gets the outputSurface parameter.
    /// The output surface fitting the input volume weights. This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
    std::shared_ptr<iolink::ArrayXd> outputSurface() const;
    /// Sets the outputSurface parameter.
    /// The output surface fitting the input volume weights. This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
    void setOutputSurface( std::shared_ptr<iolink::ArrayXd> outputSurface );

    // Method to launch the command.
    void execute();

    # Property of the inputIntensityImage parameter.
    SurfaceFitting3d.input_intensity_image
    # Property of the inputSurface parameter.
    SurfaceFitting3d.input_surface
    # Property of the directions parameter.
    SurfaceFitting3d.directions
    # Property of the distance parameter.
    SurfaceFitting3d.distance
    # Property of the thresholdRange parameter.
    SurfaceFitting3d.threshold_range
    # Property of the smoothing parameter.
    SurfaceFitting3d.smoothing
    # Property of the fittingCriterion parameter.
    SurfaceFitting3d.fitting_criterion
    # Property of the topBoundaryCondition parameter.
    SurfaceFitting3d.top_boundary_condition
    # Property of the bottomBoundaryCondition parameter.
    SurfaceFitting3d.bottom_boundary_condition
    # Property of the leftBoundaryCondition parameter.
    SurfaceFitting3d.left_boundary_condition
    # Property of the rightBoundaryCondition parameter.
    SurfaceFitting3d.right_boundary_condition
    # Property of the regularizationType parameter.
    SurfaceFitting3d.regularization_type
    # Property of the dirichletValues parameter.
    SurfaceFitting3d.dirichlet_values
    # Property of the outputSurface parameter.
    SurfaceFitting3d.output_surface

    // Method to launch the command.
    execute()

    // Command constructor.
    SurfaceFitting3d()

    // Property of the inputIntensityImage parameter.
    SurfaceFitting3d.inputIntensityImage
    // Property of the inputSurface parameter.
    SurfaceFitting3d.inputSurface
    // Property of the directions parameter.
    SurfaceFitting3d.directions
    // Property of the distance parameter.
    SurfaceFitting3d.distance
    // Property of the thresholdRange parameter.
    SurfaceFitting3d.thresholdRange
    // Property of the smoothing parameter.
    SurfaceFitting3d.smoothing
    // Property of the fittingCriterion parameter.
    SurfaceFitting3d.fittingCriterion
    // Property of the topBoundaryCondition parameter.
    SurfaceFitting3d.topBoundaryCondition
    // Property of the bottomBoundaryCondition parameter.
    SurfaceFitting3d.bottomBoundaryCondition
    // Property of the leftBoundaryCondition parameter.
    SurfaceFitting3d.leftBoundaryCondition
    // Property of the rightBoundaryCondition parameter.
    SurfaceFitting3d.rightBoundaryCondition
    // Property of the regularizationType parameter.
    SurfaceFitting3d.regularizationType
    // Property of the dirichletValues parameter.
    SurfaceFitting3d.dirichletValues
    // Property of the outputSurface parameter.
    SurfaceFitting3d.outputSurface

    // Method to launch the command.
    Execute()

## Parameters

Parameter Name | Description | Type | Supported Values | Default Value
--- | --- | --- | --- | ---
| inputSurface | The input mesh that represents the surface to fit. This mesh is represented as a three-dimensional array storing the coordinates of each vertex. The dimensions of this ArrayXd must be [3, N, M] with : 3, the number of coordinates of a 3D point, respectively corresponding to X, Y, and Z expressed in the calibration unit. N, the number of vertices per column of the mesh (N-1 cells per column). M, the number of vertices per row of the mesh (M-1 cells per row). | ArrayXd |  | nullptr
| inputIntensityImage | The 3D input image containing the weight values to consider for the fitting. | Image | Grayscale | nullptr
| directions | The search direction for each vertex. The dimensions of this ArrayXd has to be the same as the inputSurface. | ArrayXd |  | nullptr
| distance | The maximum distance to which the vertices can be moved. This distance is expressed in world coordinates of the input mesh. | Float64 | >=0 | 1
| thresholdRange | The range of values that can be considered for the best fit. A value outside of this range is considered as an outlier. | Vector2d | Any value | {0.f, 1.7976931348623157e+308f}
| smoothing | The strength of the regularization applied on the fitted mesh. A regularization is applied on the fitted mesh in order to smooth it and limit the effect of outliers. The smoothing factor defines the strength of this regularization. The greater the value is the greater the smoothing is. A smoothing value of 0 will disable the regularization. | Float64 | >=0 | 1
| fittingCriterion | The criterion according to which a vertex can be kept as the best fit. A value outside of this range is considered as an outlier.
MINIMUM | The surface is fitted on the intensity image minima.
MAXIMUM | The surface is fitted on the intensity image maxima.
| Enumeration |  | MAXIMUM
| leftBoundaryCondition | The type of boundary conditions to apply on the left of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the left border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the left border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct right neighbor.
| Enumeration |  | NEUMANN
| rightBoundaryCondition | The type of boundary conditions to apply on the right of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the right border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the right border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct left neighbor.
| Enumeration |  | NEUMANN
| topBoundaryCondition | The type of boundary conditions to apply on the top of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the top border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the top border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct bottom neighbor.
| Enumeration |  | NEUMANN
| bottomBoundaryCondition | The type of boundary conditions to apply on the bottom of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the bottom border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the bottom border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct top neighbor.
| Enumeration |  | NEUMANN
| regularizationType | The type of regularization used to smooth the mesh.
LAPLACIAN | The mesh is smoothed by a classical Laplacian operator. This type of regularization is subject to a "shrinking effect": the surface can lie slightly below the best score points (detected along the normals).
LAPLACIAN_2 | The mesh is smoothed by a second order Laplacian operator. This type of regularization does not suffer from the shrinking effect but can be less stable.
| Enumeration |  | LAPLACIAN
| dirichletValues | The Dirichlet values for the left, right, top, and bottom boundary conditions. If set to 0, the vertices are not moved on the borders for which the Dirichlet conditions are enabled. This value is ignored when the Neumann boundary conditions are enabled for the corresponding mesh border. | Vector4d | Any value | {0.f, 0.f, 0.f, 0.f}
| outputSurface | The output surface fitting the input volume weights. This mesh is represented as a three-dimensional array storing the coordinates of each vertex. The dimensions of this ArrayXd are [3, N, M] with : 3, the number of coordinates of a 3D point, respectively corresponding to X, Y, and Z expressed in the calibration unit. N, the number of vertices per column of the mesh (N-1 cells per column). M, the number of vertices per row of the mesh (M-1 cells per row). | ArrayXd |  | nullptr

Parameter Name | Description | Type | Supported Values | Default Value
--- | --- | --- | --- | ---
| input_surface | The input mesh that represents the surface to fit. This mesh is represented as a three-dimensional array storing the coordinates of each vertex. The dimensions of this ArrayXd must be [3, N, M] with : 3, the number of coordinates of a 3D point, respectively corresponding to X, Y, and Z expressed in the calibration unit. N, the number of vertices per column of the mesh (N-1 cells per column). M, the number of vertices per row of the mesh (M-1 cells per row). | arrayXd |  | nullptr
| input_intensity_image | The 3D input image containing the weight values to consider for the fitting. | image | Grayscale | None
| directions | The search direction for each vertex. The dimensions of this ArrayXd has to be the same as the inputSurface. | arrayXd |  | nullptr
| distance | The maximum distance to which the vertices can be moved. This distance is expressed in world coordinates of the input mesh. | float64 | >=0 | 1
| threshold_range | The range of values that can be considered for the best fit. A value outside of this range is considered as an outlier. | vector2d | Any value | [0, 1.7976931348623157e+308]
| smoothing | The strength of the regularization applied on the fitted mesh. A regularization is applied on the fitted mesh in order to smooth it and limit the effect of outliers. The smoothing factor defines the strength of this regularization. The greater the value is the greater the smoothing is. A smoothing value of 0 will disable the regularization. | float64 | >=0 | 1
| fitting_criterion | The criterion according to which a vertex can be kept as the best fit. A value outside of this range is considered as an outlier.
MINIMUM | The surface is fitted on the intensity image minima.
MAXIMUM | The surface is fitted on the intensity image maxima.
| enumeration |  | MAXIMUM
| left_boundary_condition | The type of boundary conditions to apply on the left of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the left border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the left border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct right neighbor.
| enumeration |  | NEUMANN
| right_boundary_condition | The type of boundary conditions to apply on the right of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the right border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the right border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct left neighbor.
| enumeration |  | NEUMANN
| top_boundary_condition | The type of boundary conditions to apply on the top of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the top border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the top border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct bottom neighbor.
| enumeration |  | NEUMANN
| bottom_boundary_condition | The type of boundary conditions to apply on the bottom of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the bottom border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the bottom border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct top neighbor.
| enumeration |  | NEUMANN
| regularization_type | The type of regularization used to smooth the mesh.
LAPLACIAN | The mesh is smoothed by a classical Laplacian operator. This type of regularization is subject to a "shrinking effect": the surface can lie slightly below the best score points (detected along the normals).
LAPLACIAN_2 | The mesh is smoothed by a second order Laplacian operator. This type of regularization does not suffer from the shrinking effect but can be less stable.
| enumeration |  | LAPLACIAN
| dirichlet_values | The Dirichlet values for the left, right, top, and bottom boundary conditions. If set to 0, the vertices are not moved on the borders for which the Dirichlet conditions are enabled. This value is ignored when the Neumann boundary conditions are enabled for the corresponding mesh border. | vector4d | Any value | [0, 0, 0, 0]
| output_surface | The output surface fitting the input volume weights. This mesh is represented as a three-dimensional array storing the coordinates of each vertex. The dimensions of this ArrayXd are [3, N, M] with : 3, the number of coordinates of a 3D point, respectively corresponding to X, Y, and Z expressed in the calibration unit. N, the number of vertices per column of the mesh (N-1 cells per column). M, the number of vertices per row of the mesh (M-1 cells per row). | arrayXd |  | nullptr

Parameter Name | Description | Type | Supported Values | Default Value
--- | --- | --- | --- | ---
| inputSurface | The input mesh that represents the surface to fit. This mesh is represented as a three-dimensional array storing the coordinates of each vertex. The dimensions of this ArrayXd must be [3, N, M] with : 3, the number of coordinates of a 3D point, respectively corresponding to X, Y, and Z expressed in the calibration unit. N, the number of vertices per column of the mesh (N-1 cells per column). M, the number of vertices per row of the mesh (M-1 cells per row). | ArrayXd |  | nullptr
| inputIntensityImage | The 3D input image containing the weight values to consider for the fitting. | Image | Grayscale | null
| directions | The search direction for each vertex. The dimensions of this ArrayXd has to be the same as the inputSurface. | ArrayXd |  | nullptr
| distance | The maximum distance to which the vertices can be moved. This distance is expressed in world coordinates of the input mesh. | Float64 | >=0 | 1
| thresholdRange | The range of values that can be considered for the best fit. A value outside of this range is considered as an outlier. | Vector2d | Any value | {0f, double.MaxValue}
| smoothing | The strength of the regularization applied on the fitted mesh. A regularization is applied on the fitted mesh in order to smooth it and limit the effect of outliers. The smoothing factor defines the strength of this regularization. The greater the value is the greater the smoothing is. A smoothing value of 0 will disable the regularization. | Float64 | >=0 | 1
| fittingCriterion | The criterion according to which a vertex can be kept as the best fit. A value outside of this range is considered as an outlier.
MINIMUM | The surface is fitted on the intensity image minima.
MAXIMUM | The surface is fitted on the intensity image maxima.
| Enumeration |  | MAXIMUM
| leftBoundaryCondition | The type of boundary conditions to apply on the left of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the left border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the left border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct right neighbor.
| Enumeration |  | NEUMANN
| rightBoundaryCondition | The type of boundary conditions to apply on the right of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the right border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the right border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct left neighbor.
| Enumeration |  | NEUMANN
| topBoundaryCondition | The type of boundary conditions to apply on the top of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the top border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the top border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct bottom neighbor.
| Enumeration |  | NEUMANN
| bottomBoundaryCondition | The type of boundary conditions to apply on the bottom of the mesh.
DIRICHLET | The Dirichlet boundary conditions are enabled for the bottom border. Displacements of vertices are clamped to the value defined by the parameter dirichletValues.
NEUMANN | The Neumann boundary conditions are enabled for the bottom border. The variation of displacements in the direction perpendicular to the border is null. It means that the displacement of a vertex at the border is equal to the displacement of its direct top neighbor.
| Enumeration |  | NEUMANN
| regularizationType | The type of regularization used to smooth the mesh.
LAPLACIAN | The mesh is smoothed by a classical Laplacian operator. This type of regularization is subject to a "shrinking effect": the surface can lie slightly below the best score points (detected along the normals).
LAPLACIAN_2 | The mesh is smoothed by a second order Laplacian operator. This type of regularization does not suffer from the shrinking effect but can be less stable.
| Enumeration |  | LAPLACIAN
| dirichletValues | The Dirichlet values for the left, right, top, and bottom boundary conditions. If set to 0, the vertices are not moved on the borders for which the Dirichlet conditions are enabled. This value is ignored when the Neumann boundary conditions are enabled for the corresponding mesh border. | Vector4d | Any value | {0f, 0f, 0f, 0f}
| outputSurface | The output surface fitting the input volume weights. This mesh is represented as a three-dimensional array storing the coordinates of each vertex. The dimensions of this ArrayXd are [3, N, M] with : 3, the number of coordinates of a 3D point, respectively corresponding to X, Y, and Z expressed in the calibration unit. N, the number of vertices per column of the mesh (N-1 cells per column). M, the number of vertices per row of the mesh (M-1 cells per row). | ArrayXd |  | nullptr

## Object Examples

    auto dental_distmap = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_distmap.vip" );
    std::shared_ptr< iolink::ArrayXd> dental_extruded_mesh( new iolink::ArrayXd( { 0 } ) );
    readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_extruded_mesh.arrayxd", dental_extruded_mesh);
    std::shared_ptr< iolink::ArrayXd> dental_normals( new iolink::ArrayXd( { 0 } ) );
    readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_normals.arrayxd", dental_normals);

    SurfaceFitting3d surfaceFitting3dAlgo;
    surfaceFitting3dAlgo.setInputIntensityImage( dental_distmap );
    surfaceFitting3dAlgo.setInputSurface( dental_extruded_mesh );
    surfaceFitting3dAlgo.setDirections( dental_normals );
    surfaceFitting3dAlgo.setDistance( 15 );
    surfaceFitting3dAlgo.setThresholdRange( {0, 1000000} );
    surfaceFitting3dAlgo.setSmoothing( 10 );
    surfaceFitting3dAlgo.setFittingCriterion( SurfaceFitting3d::FittingCriterion::MAXIMUM );
    surfaceFitting3dAlgo.setTopBoundaryCondition( SurfaceFitting3d::BoundaryCondition::NEUMANN );
    surfaceFitting3dAlgo.setBottomBoundaryCondition( SurfaceFitting3d::BoundaryCondition::NEUMANN );
    surfaceFitting3dAlgo.setLeftBoundaryCondition( SurfaceFitting3d::BoundaryCondition::DIRICHLET );
    surfaceFitting3dAlgo.setRightBoundaryCondition( SurfaceFitting3d::BoundaryCondition::DIRICHLET );
    surfaceFitting3dAlgo.setRegularizationType( SurfaceFitting3d::RegularizationType::LAPLACIAN_2 );
    surfaceFitting3dAlgo.setDirichletValues( {15, 15, 15, 15} );
    surfaceFitting3dAlgo.execute();

    std::cout << "outputSurface:" << surfaceFitting3dAlgo.outputSurface()->shape();

    dental_distmap = imagedev.read_vip_image(imagedev_data.get_image_path("dental_distmap.vip"))
    dental_extruded_mesh = np.zeros(0, dtype=np.double)
    dental_extruded_mesh = imagedev.read_array_xd(imagedev_data.get_object_path("dental_extruded_mesh.arrayxd"), dental_extruded_mesh)
    dental_normals = np.zeros(0, dtype=np.double)
    dental_normals = imagedev.read_array_xd(imagedev_data.get_object_path("dental_normals.arrayxd"), dental_normals)

    surface_fitting_3d_algo = imagedev.SurfaceFitting3d()
    surface_fitting_3d_algo.input_intensity_image = dental_distmap
    surface_fitting_3d_algo.input_surface = dental_extruded_mesh
    surface_fitting_3d_algo.directions = dental_normals
    surface_fitting_3d_algo.distance = 15
    surface_fitting_3d_algo.threshold_range = [0, 1000000]
    surface_fitting_3d_algo.smoothing = 10
    surface_fitting_3d_algo.fitting_criterion = imagedev.SurfaceFitting3d.MAXIMUM
    surface_fitting_3d_algo.top_boundary_condition = imagedev.SurfaceFitting3d.NEUMANN
    surface_fitting_3d_algo.bottom_boundary_condition = imagedev.SurfaceFitting3d.NEUMANN
    surface_fitting_3d_algo.left_boundary_condition = imagedev.SurfaceFitting3d.DIRICHLET
    surface_fitting_3d_algo.right_boundary_condition = imagedev.SurfaceFitting3d.DIRICHLET
    surface_fitting_3d_algo.regularization_type = imagedev.SurfaceFitting3d.LAPLACIAN_2
    surface_fitting_3d_algo.dirichlet_values = [15, 15, 15, 15]
    surface_fitting_3d_algo.execute()

    print("output_surface:", str(surface_fitting_3d_algo.output_surface))

    ImageView dental_distmap = Data.ReadVipImage( @"Data/images/dental_distmap.vip" );
    IOLink.ArrayXd dental_extruded_mesh = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
    dental_extruded_mesh = Data.ReadArrayXd( @"Data/objects/dental_extruded_mesh.arrayxd", dental_extruded_mesh );
    IOLink.ArrayXd dental_normals = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
    dental_normals = Data.ReadArrayXd( @"Data/objects/dental_normals.arrayxd", dental_normals );

    SurfaceFitting3d surfaceFitting3dAlgo = new SurfaceFitting3d
    {
        inputIntensityImage = dental_distmap,
        inputSurface = dental_extruded_mesh,
        directions = dental_normals,
        distance = 15,
        thresholdRange = new double[]{0, 1000000},
        smoothing = 10,
        fittingCriterion = SurfaceFitting3d.FittingCriterion.MAXIMUM,
        topBoundaryCondition = SurfaceFitting3d.BoundaryCondition.NEUMANN,
        bottomBoundaryCondition = SurfaceFitting3d.BoundaryCondition.NEUMANN,
        leftBoundaryCondition = SurfaceFitting3d.BoundaryCondition.DIRICHLET,
        rightBoundaryCondition = SurfaceFitting3d.BoundaryCondition.DIRICHLET,
        regularizationType = SurfaceFitting3d.RegularizationType.LAPLACIAN_2,
        dirichletValues = new double[]{15, 15, 15, 15}
    };
    surfaceFitting3dAlgo.Execute();

    Console.WriteLine( "outputSurface:" + surfaceFitting3dAlgo.outputSurface.ToString() );

## Function Examples

    auto dental_distmap = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_distmap.vip" );
    std::shared_ptr< iolink::ArrayXd> dental_extruded_mesh( new iolink::ArrayXd( { 0 } ) );
    readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_extruded_mesh.arrayxd", dental_extruded_mesh);
    std::shared_ptr< iolink::ArrayXd> dental_normals( new iolink::ArrayXd( { 0 } ) );
    readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_normals.arrayxd", dental_normals);

    auto result = surfaceFitting3d( dental_distmap, dental_extruded_mesh, dental_normals, 15, {0, 1000000}, 10, SurfaceFitting3d::FittingCriterion::MAXIMUM, SurfaceFitting3d::BoundaryCondition::NEUMANN, SurfaceFitting3d::BoundaryCondition::NEUMANN, SurfaceFitting3d::BoundaryCondition::DIRICHLET, SurfaceFitting3d::BoundaryCondition::DIRICHLET, SurfaceFitting3d::RegularizationType::LAPLACIAN_2, {15, 15, 15, 15} );

    std::cout << "outputSurface:" << result->shape();

    dental_distmap = imagedev.read_vip_image(imagedev_data.get_image_path("dental_distmap.vip"))
    dental_extruded_mesh = np.zeros(0, dtype=np.double)
    dental_extruded_mesh = imagedev.read_array_xd(imagedev_data.get_object_path("dental_extruded_mesh.arrayxd"), dental_extruded_mesh)
    dental_normals = np.zeros(0, dtype=np.double)
    dental_normals = imagedev.read_array_xd(imagedev_data.get_object_path("dental_normals.arrayxd"), dental_normals)

    result = imagedev.surface_fitting_3d(dental_distmap, dental_extruded_mesh, dental_normals, 15, [0, 1000000], 10, imagedev.SurfaceFitting3d.MAXIMUM, imagedev.SurfaceFitting3d.NEUMANN, imagedev.SurfaceFitting3d.NEUMANN, imagedev.SurfaceFitting3d.DIRICHLET, imagedev.SurfaceFitting3d.DIRICHLET, imagedev.SurfaceFitting3d.LAPLACIAN_2, [15, 15, 15, 15])

    print("output_surface:", str(result))

    ImageView dental_distmap = Data.ReadVipImage( @"Data/images/dental_distmap.vip" );
    IOLink.ArrayXd dental_extruded_mesh = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
    dental_extruded_mesh = Data.ReadArrayXd( @"Data/objects/dental_extruded_mesh.arrayxd", dental_extruded_mesh );
    IOLink.ArrayXd dental_normals = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
    dental_normals = Data.ReadArrayXd( @"Data/objects/dental_normals.arrayxd", dental_normals );

    IOLink.ArrayXd result = Processing.SurfaceFitting3d( dental_distmap, dental_extruded_mesh, dental_normals, 15, new double[]{0, 1000000}, 10, SurfaceFitting3d.FittingCriterion.MAXIMUM, SurfaceFitting3d.BoundaryCondition.NEUMANN, SurfaceFitting3d.BoundaryCondition.NEUMANN, SurfaceFitting3d.BoundaryCondition.DIRICHLET, SurfaceFitting3d.BoundaryCondition.DIRICHLET, SurfaceFitting3d.RegularizationType.LAPLACIAN_2, new double[]{15, 15, 15, 15} );

    Console.WriteLine( "outputSurface:" + result.ToString() );

© 2025 Thermo Fisher Scientific Inc. All rights reserved.