ImageDev

DentalMeshExtraction3d

Computes a quadrilateral mesh fitting on the dental wall defined in a three-dimensional binary image.

Access to parameter description

For an introduction to dental panoramics: section Dental applications

This algorithm extracts a mesh and fits it on a binary dental wall computed with the DentalWallSegmentation3d algorithm.
The output surface is a quadrilateral mesh for which Each cell can be considered as a square, even if for approximation reasons, column and row lengths may slightly differ.
Cells are extracted to represent approximately 10x10 voxel squares in the input volume.
The main steps of this algorithm are: Fitting of this mesh on a weight volume representing the center of the teeth for building an arch mesh.
If an input arch curve is provided, the first step is skipped. This arch curve is systematically resampled to generate a polyline on which two consecutive vertices are approximately 10 voxels apart.



Figure 2. Dental mesh extraction: (left) the initial CBCT and (right) the resulting mesh


See also

Function Syntax

This function returns a DentalMeshExtraction3dOutput structure containing the outputArchCurve, outputInsideArchCurve, outputOutsideArchCurve, outputDirections and outputMesh output parameters.
// Output structure.
struct DentalMeshExtraction3dOutput
{
    std::shared_ptr<iolink::ArrayXd> inputArchCurve;
    std::shared_ptr<iolink::ArrayXd> outputArchCurve;
    std::shared_ptr<iolink::ArrayXd> outputInsideArchCurve;
    std::shared_ptr<iolink::ArrayXd> outputOutsideArchCurve;
    std::shared_ptr<iolink::ArrayXd> outputDirections;
    std::shared_ptr<iolink::ArrayXd> outputMesh;
};

// Function prototype.
DentalMeshExtraction3dOutput
dentalMeshExtraction3d( std::shared_ptr< iolink::ImageView > inputBinaryImage,
                        std::shared_ptr< iolink::ImageView > inputImage,
                        std::shared_ptr<iolink::ArrayXd> inputArchCurve,
                        double extrusionDown,
                        double extrusionUp,
                        double searchLength,
                        std::shared_ptr<iolink::ArrayXd> outputArchCurve = NULL,
                        std::shared_ptr<iolink::ArrayXd> outputInsideArchCurve = NULL,
                        std::shared_ptr<iolink::ArrayXd> outputOutsideArchCurve = NULL,
                        std::shared_ptr<iolink::ArrayXd> outputDirections = NULL,
                        std::shared_ptr<iolink::ArrayXd> outputMesh = NULL );
This function returns a tuple containing the output_arch_curve, output_inside_arch_curve, output_outside_arch_curve, output_directions and output_mesh output parameters.
// Function prototype.
dental_mesh_extraction_3d( input_binary_image,
                           input_image,
                           input_arch_curve,
                           extrusion_down = 30,
                           extrusion_up = 30,
                           search_length = 15,
                           output_arch_curve = None,
                           output_inside_arch_curve = None,
                           output_outside_arch_curve = None,
                           output_directions = None,
                           output_mesh = None )
This function returns a DentalMeshExtraction3dOutput structure containing the outputArchCurve, outputInsideArchCurve, outputOutsideArchCurve, outputDirections and outputMesh output parameters.
/// Output structure of the DentalMeshExtraction3d function.
public struct DentalMeshExtraction3dOutput
{
    public IOLink.ArrayXd inputArchCurve;
    public IOLink.ArrayXd outputArchCurve;
    public IOLink.ArrayXd outputInsideArchCurve;
    public IOLink.ArrayXd outputOutsideArchCurve;
    public IOLink.ArrayXd outputDirections;
    public IOLink.ArrayXd outputMesh;
};

// Function prototype.
public static DentalMeshExtraction3dOutput
DentalMeshExtraction3d( IOLink.ImageView inputBinaryImage,
                        IOLink.ImageView inputImage,
                        IOLink.ArrayXd inputArchCurve,
                        double extrusionDown = 30,
                        double extrusionUp = 30,
                        double searchLength = 15,
                        IOLink.ArrayXd outputArchCurve = null,
                        IOLink.ArrayXd outputInsideArchCurve = null,
                        IOLink.ArrayXd outputOutsideArchCurve = null,
                        IOLink.ArrayXd outputDirections = null,
                        IOLink.ArrayXd outputMesh = null );

Class Syntax

Parameters

Class Name DentalMeshExtraction3d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The input binary image representing the extracted dental wall. Its dimensions are equal to the input image dimensions divided by the sampling factor used at the segmentation step. Image Binary or Grayscale nullptr
input
inputImage
The input 3D CBCT image of the head (LP orientation). It is used to compute automatically the arch curve. It is ignored if an input arch curve is user-defined Image Grayscale nullptr
input
inputArchCurve
The polyline representing the dental arch in the XY plan. This polyline must be represented as a two-dimensional array storing the coordinates of each vertex. If not set, it is automatically computed.
The indexation of this ArrayXd must be {coordinate, index}, where coordinate is the axis index (0 for X, 1 for Y and 2 for Z) and index is a label identifying the vertex.
ArrayXd nullptr
input
extrusionDown
The extrusion length of dental arch curve in the direction of head towards feet. This length is expressed in mm. Float64 >=0 30
input
extrusionUp
The extrusion length of dental arch curve in the direction of feet towards head. This length is expressed in mm. Float64 >=0 30
input
searchLength
The search distance where the initial mesh is fitted to the arch curve. This distance is expressed in mm. Float64 >=0 15
output
outputArchCurve
The polyline representing the dental arch which is used to compute the arch mesh. This polyline is represented as a two-dimensional array storing the coordinates of each vertex. . If the input arch curve is not set, it is automatically computed from the input CBCT image. Otherwise, it corresponds to the resampled input arch curve. Curve vertex coordinates are expressed in mm.
The indexation of the generated ArrayXd is {coordinate, index}, where coordinate is the axis index (0 for X, 1 for Y and 2 for Z) and index is a label identifying the vertex.
ArrayXd nullptr
output
outputInsideArchCurve
The polyline representing the inside border of the search area for fitting the arch mesh. This curve is computed by shifting the arch curve inside the jaws to the search distance. This polyline is represented as a two-dimensional array storing the coordinates of each vertex. Curve vertex coordinates are expressed in mm.
The indexation of the generated ArrayXd is {coordinate, index}, where coordinate is the axis index (0 for X, 1 for Y and 2 for Z) and index is a label identifying the vertex.
ArrayXd nullptr
output
outputOutsideArchCurve
The polyline representing the outside border of the search area for fitting the arch mesh. This curve is computed by shifting the arch curve outside the jaws to the search distance. This polyline is represented as a two-dimensional array storing the coordinates of each vertex. Curve vertices are expressed in mm.
The indexation of the generated ArrayXd is {coordinate, index}, where coordinate is the axis index (0 for X, 1 for Y and 2 for Z) and index is a label identifying the vertex.
ArrayXd nullptr
output
outputDirections
The arch mesh vertex normals. These directions are calculated on the initial mesh prior to fitting. It is recommended to use these normals to unfold the tooth dental and generate a panoramic. The fitted mesh vertex normals tend to cross each other and therefore generate artifacts.
The dimensions of this ArrayXd are [3, N, M] with :
  • 3, the number of coordinates of a 3D vector, respectively corresponding to X, Y, and Z.
  • 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
output
outputMesh
The quadrilateral mesh forming the surface fitted to the dental wall. This surface can be used to unfold the dental wall and generate a panoramic. This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
  • 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_binary = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_binary.vip" );
std::shared_ptr< iolink::ImageView > dental_cbct = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_cbct.am" );

DentalMeshExtraction3d dentalMeshExtraction3dAlgo;
dentalMeshExtraction3dAlgo.setInputBinaryImage( dental_binary );
dentalMeshExtraction3dAlgo.setInputImage( dental_cbct );
dentalMeshExtraction3dAlgo.setInputArchCurve( nullptr );
dentalMeshExtraction3dAlgo.setExtrusionDown( 30 );
dentalMeshExtraction3dAlgo.setExtrusionUp( 30 );
dentalMeshExtraction3dAlgo.setSearchLength( 15 );
dentalMeshExtraction3dAlgo.execute();

std::cout << "outputArchCurve:" << dentalMeshExtraction3dAlgo.outputArchCurve()->shape();
std::cout << "outputInsideArchCurve:" << dentalMeshExtraction3dAlgo.outputInsideArchCurve()->shape();
std::cout << "outputOutsideArchCurve:" << dentalMeshExtraction3dAlgo.outputOutsideArchCurve()->shape();
std::cout << "outputDirections:" << dentalMeshExtraction3dAlgo.outputDirections()->shape();
std::cout << "outputMesh:" << dentalMeshExtraction3dAlgo.outputMesh()->shape();
dental_binary = imagedev.read_vip_image(imagedev_data.get_image_path("dental_binary.vip"))
dental_cbct = ioformat.read_image(imagedev_data.get_image_path("dental_cbct.am"))

dental_mesh_extraction_3d_algo = imagedev.DentalMeshExtraction3d()
dental_mesh_extraction_3d_algo.input_binary_image = dental_binary
dental_mesh_extraction_3d_algo.input_image = dental_cbct
dental_mesh_extraction_3d_algo.input_arch_curve = None
dental_mesh_extraction_3d_algo.extrusion_down = 30
dental_mesh_extraction_3d_algo.extrusion_up = 30
dental_mesh_extraction_3d_algo.search_length = 15
dental_mesh_extraction_3d_algo.execute()

print( "output_arch_curve:", str( dental_mesh_extraction_3d_algo.output_arch_curve ) )
print( "output_inside_arch_curve:", str( dental_mesh_extraction_3d_algo.output_inside_arch_curve ) )
print( "output_outside_arch_curve:", str( dental_mesh_extraction_3d_algo.output_outside_arch_curve ) )
print( "output_directions:", str( dental_mesh_extraction_3d_algo.output_directions ) )
print( "output_mesh:", str( dental_mesh_extraction_3d_algo.output_mesh ) )
ImageView dental_binary = Data.ReadVipImage( @"Data/images/dental_binary.vip" );
ImageView dental_cbct = ViewIO.ReadImage( @"Data/images/dental_cbct.am" );

DentalMeshExtraction3d dentalMeshExtraction3dAlgo = new DentalMeshExtraction3d
{
    inputBinaryImage = dental_binary,
    inputImage = dental_cbct,
    inputArchCurve = null,
    extrusionDown = 30,
    extrusionUp = 30,
    searchLength = 15
};
dentalMeshExtraction3dAlgo.Execute();

Console.WriteLine( "outputArchCurve:" + dentalMeshExtraction3dAlgo.outputArchCurve.ToString() );
Console.WriteLine( "outputInsideArchCurve:" + dentalMeshExtraction3dAlgo.outputInsideArchCurve.ToString() );
Console.WriteLine( "outputOutsideArchCurve:" + dentalMeshExtraction3dAlgo.outputOutsideArchCurve.ToString() );
Console.WriteLine( "outputDirections:" + dentalMeshExtraction3dAlgo.outputDirections.ToString() );
Console.WriteLine( "outputMesh:" + dentalMeshExtraction3dAlgo.outputMesh.ToString() );

Function Examples

auto dental_binary = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_binary.vip" );
std::shared_ptr< iolink::ImageView > dental_cbct = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_cbct.am" );

auto result = dentalMeshExtraction3d( dental_binary, dental_cbct, nullptr, 30, 30, 15 );

std::cout << "outputArchCurve:" << result.outputArchCurve->shape();
std::cout << "outputInsideArchCurve:" << result.outputInsideArchCurve->shape();
std::cout << "outputOutsideArchCurve:" << result.outputOutsideArchCurve->shape();
std::cout << "outputDirections:" << result.outputDirections->shape();
std::cout << "outputMesh:" << result.outputMesh->shape();
dental_binary = imagedev.read_vip_image(imagedev_data.get_image_path("dental_binary.vip"))
dental_cbct = ioformat.read_image(imagedev_data.get_image_path("dental_cbct.am"))

result_output_arch_curve, result_output_inside_arch_curve, result_output_outside_arch_curve, result_output_directions, result_output_mesh = imagedev.dental_mesh_extraction_3d( dental_binary, dental_cbct, None, 30, 30, 15 )

print( "output_arch_curve:", str( result_output_arch_curve ) )
print( "output_inside_arch_curve:", str( result_output_inside_arch_curve ) )
print( "output_outside_arch_curve:", str( result_output_outside_arch_curve ) )
print( "output_directions:", str( result_output_directions ) )
print( "output_mesh:", str( result_output_mesh ) )
ImageView dental_binary = Data.ReadVipImage( @"Data/images/dental_binary.vip" );
ImageView dental_cbct = ViewIO.ReadImage( @"Data/images/dental_cbct.am" );

Processing.DentalMeshExtraction3dOutput result = Processing.DentalMeshExtraction3d( dental_binary, dental_cbct, null, 30, 30, 15 );

Console.WriteLine( "outputArchCurve:" + result.outputArchCurve.ToString() );
Console.WriteLine( "outputInsideArchCurve:" + result.outputInsideArchCurve.ToString() );
Console.WriteLine( "outputOutsideArchCurve:" + result.outputOutsideArchCurve.ToString() );
Console.WriteLine( "outputDirections:" + result.outputDirections.ToString() );
Console.WriteLine( "outputMesh:" + result.outputMesh.ToString() );