ImageDev

DentalUnfolding3d

Extracts a flattened volume and image from an input three-dimensional image mapped to a surface mesh.

Access to parameter description

This algorithm unfolds a 3D surface defined in an input mesh, in order to make it appear as a flat layer of the output 3D panoramic volume.

The panoramic output volume is a 3D image corresponding to the region of the input volume defined by the input surface and a given thickness. The dimensions in voxels of the output image are automatically adjusted to preserve the resolution of the input volume. The X axis of the output volume corresponds to the teeth arch curve, its Y axis to the extrusion direction (generally the Z axis of the initial volume) and its Z axis the slab thickness (orthogonal direction to the mesh cells).

By default the thickness of the output volume is taken in the direction of the normal vectors to each cell of the input mesh. If this behavior is not desired, these directions can be redefined with the directions parameter. The panoramic output image is computed as the maxima projection of the panoramic volume along its thickness. A sharpening is applied to mitigate the blur induced by the resampling and projection steps.

See also

Function Syntax

This function returns a DentalUnfolding3dOutput structure containing outputPanoramicImage and outputPanoramicVolume.
// Output structure of the dentalUnfolding3d function.
struct DentalUnfolding3dOutput
{
    /// The output panoramic image representing unfolded jaws. The width of this volume is defined by arch curve length. Its height is defined by the sum of the lower and upper extrusion lengths.
    std::shared_ptr< iolink::ImageView > outputPanoramicImage;
    /// The output panoramic volume given by unfolding the surface defined by the arch mesh. The width of this volume is defined by arch curve length. Its height is defined by the sum of the lower and upper extrusion lengths. Its thickness is defined by the volume thickness.
    std::shared_ptr< iolink::ImageView > outputPanoramicVolume;
    /// The quadrilateral mesh forming the surface fitted to the dental wall used to generate the output panoramic This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
    std::shared_ptr<iolink::ArrayXd> inputMesh;
    /// Optional direction vectors used to define the Z axis of the output volume.
    std::shared_ptr<iolink::ArrayXd> inputDirections;
};

// Function prototype
DentalUnfolding3dOutput dentalUnfolding3d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr<iolink::ArrayXd> inputMesh, std::shared_ptr<iolink::ArrayXd> inputDirections, double volumeThickness, uint32_t slabThickness, double sharpening, std::shared_ptr< iolink::ImageView > outputPanoramicImage = NULL, std::shared_ptr< iolink::ImageView > outputPanoramicVolume = NULL );
This function returns a tuple containing output_panoramic_image and output_panoramic_volume.
// Function prototype.
dental_unfolding_3d( input_image,
                     input_mesh,
                     input_directions,
                     volume_thickness = 15,
                     slab_thickness = 3,
                     sharpening = 4,
                     output_panoramic_image = None,
                     output_panoramic_volume = None )
This function returns a DentalUnfolding3dOutput structure containing outputPanoramicImage and outputPanoramicVolume.
/// Output structure of the DentalUnfolding3d function.
public struct DentalUnfolding3dOutput
{
    /// 
    /// The output panoramic image representing unfolded jaws. The width of this volume is defined by arch curve length. Its height is defined by the sum of the lower and upper extrusion lengths.
    /// 
    public IOLink.ImageView outputPanoramicImage;
    /// 
    /// The output panoramic volume given by unfolding the surface defined by the arch mesh. The width of this volume is defined by arch curve length. Its height is defined by the sum of the lower and upper extrusion lengths. Its thickness is defined by the volume thickness.
    /// 
    public IOLink.ImageView outputPanoramicVolume;
    /// 
    /// The quadrilateral mesh forming the surface fitted to the dental wall used to generate the output panoramic This mesh is represented as a three-dimensional array storing the coordinates of each vertex.
    /// 
    public IOLink.ArrayXd inputMesh;
    /// Optional direction vectors used to define the Z axis of the output volume.
    public IOLink.ArrayXd inputDirections;
};

// Function prototype.
public static DentalUnfolding3dOutput
DentalUnfolding3d( IOLink.ImageView inputImage,
                   IOLink.ArrayXd inputMesh,
                   IOLink.ArrayXd inputDirections,
                   double volumeThickness = 15,
                   UInt32 slabThickness = 3,
                   double sharpening = 4,
                   IOLink.ImageView outputPanoramicImage = null,
                   IOLink.ImageView outputPanoramicVolume = null );

Class Syntax

Parameters

Class Name DentalUnfolding3d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input 3D CBCT image of the head (LP orientation) to unfold. Image Grayscale nullptr
input
inputMesh
The quadrilateral mesh forming the surface fitted to the dental wall used to generate the output panoramic 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
input
inputDirections
Optional direction vectors used to define the Z axis of the output volume.
By default this parameter does not contain any data, which means that the algorithm will compute direction vectors as the normal vector to each vertex of the input mesh.
Nevertheless, it is recommended to set the directions calculated on the initial mesh prior to fitting, at the mesh extraction step.
If provided, its dimensions must be equivalent to the [3, N, M] dimensions of the inputMesh 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
input
volumeThickness
The thickness of the output panoramic volume. This thickness is expressed in mm. Float64 >=0 15
input
slabThickness
Set the number of slices of the panoramic volume used to build the output panoramic image. UInt32 >=1 3
input
sharpening
The extrusion length of dental arch curve in the direction of head towards feet. This length is expressed in mm. Float64 >0 4
output
outputPanoramicImage
The output panoramic image representing unfolded jaws. The width of this volume is defined by arch curve length. Its height is defined by the sum of the lower and upper extrusion lengths. Image nullptr
output
outputPanoramicVolume
The output panoramic volume given by unfolding the surface defined by the arch mesh. The width of this volume is defined by arch curve length. Its height is defined by the sum of the lower and upper extrusion lengths. Its thickness is defined by the volume thickness. Image nullptr

Object Examples

std::shared_ptr< iolink::ImageView > dental_cbct = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_cbct.am" );
std::shared_ptr< iolink::ArrayXd> dental_fitted_mesh( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_fitted_mesh.arrayxd", dental_fitted_mesh);
std::shared_ptr< iolink::ArrayXd> dental_directions( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_directions.arrayxd", dental_directions);

DentalUnfolding3d dentalUnfolding3dAlgo;
dentalUnfolding3dAlgo.setInputImage( dental_cbct );
dentalUnfolding3dAlgo.setInputMesh( dental_fitted_mesh );
dentalUnfolding3dAlgo.setInputDirections( dental_directions );
dentalUnfolding3dAlgo.setVolumeThickness( 15 );
dentalUnfolding3dAlgo.setSlabThickness( 3 );
dentalUnfolding3dAlgo.setSharpening( 4 );
dentalUnfolding3dAlgo.execute();

std::cout << "outputPanoramicImage:" << dentalUnfolding3dAlgo.outputPanoramicImage()->toString();
std::cout << "outputPanoramicVolume:" << dentalUnfolding3dAlgo.outputPanoramicVolume()->toString();
dental_cbct = ioformat.read_image(imagedev_data.get_image_path("dental_cbct.am"))
dental_fitted_mesh = np.zeros(0, dtype=np.double)
dental_fitted_mesh = imagedev.read_array_xd(imagedev_data.get_object_path("dental_fitted_mesh.arrayxd"), dental_fitted_mesh)
dental_directions = np.zeros(0, dtype=np.double)
dental_directions = imagedev.read_array_xd(imagedev_data.get_object_path("dental_directions.arrayxd"), dental_directions)

dental_unfolding_3d_algo = imagedev.DentalUnfolding3d()
dental_unfolding_3d_algo.input_image = dental_cbct
dental_unfolding_3d_algo.input_mesh = dental_fitted_mesh
dental_unfolding_3d_algo.input_directions = dental_directions
dental_unfolding_3d_algo.volume_thickness = 15
dental_unfolding_3d_algo.slab_thickness = 3
dental_unfolding_3d_algo.sharpening = 4
dental_unfolding_3d_algo.execute()

print( "output_panoramic_image:", str( dental_unfolding_3d_algo.output_panoramic_image ) )
print( "output_panoramic_volume:", str( dental_unfolding_3d_algo.output_panoramic_volume ) )
ImageView dental_cbct = ViewIO.ReadImage( @"Data/images/dental_cbct.am" );
IOLink.ArrayXd dental_fitted_mesh = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
dental_fitted_mesh = Data.ReadArrayXd( @"Data/objects/dental_fitted_mesh.arrayxd", dental_fitted_mesh );
IOLink.ArrayXd dental_directions = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
dental_directions = Data.ReadArrayXd( @"Data/objects/dental_directions.arrayxd", dental_directions );

DentalUnfolding3d dentalUnfolding3dAlgo = new DentalUnfolding3d
{
    inputImage = dental_cbct,
    inputMesh = dental_fitted_mesh,
    inputDirections = dental_directions,
    volumeThickness = 15,
    slabThickness = 3,
    sharpening = 4
};
dentalUnfolding3dAlgo.Execute();

Console.WriteLine( "outputPanoramicImage:" + dentalUnfolding3dAlgo.outputPanoramicImage.ToString() );
Console.WriteLine( "outputPanoramicVolume:" + dentalUnfolding3dAlgo.outputPanoramicVolume.ToString() );

Function Examples

std::shared_ptr< iolink::ImageView > dental_cbct = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "dental_cbct.am" );
std::shared_ptr< iolink::ArrayXd> dental_fitted_mesh( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_fitted_mesh.arrayxd", dental_fitted_mesh);
std::shared_ptr< iolink::ArrayXd> dental_directions( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "dental_directions.arrayxd", dental_directions);

auto result = dentalUnfolding3d( dental_cbct, dental_fitted_mesh, dental_directions, 15, 3, 4 );

std::cout << "outputPanoramicImage:" << result.outputPanoramicImage->toString();
std::cout << "outputPanoramicVolume:" << result.outputPanoramicVolume->toString();
dental_cbct = ioformat.read_image(imagedev_data.get_image_path("dental_cbct.am"))
dental_fitted_mesh = np.zeros(0, dtype=np.double)
dental_fitted_mesh = imagedev.read_array_xd(imagedev_data.get_object_path("dental_fitted_mesh.arrayxd"), dental_fitted_mesh)
dental_directions = np.zeros(0, dtype=np.double)
dental_directions = imagedev.read_array_xd(imagedev_data.get_object_path("dental_directions.arrayxd"), dental_directions)

result_output_panoramic_image, result_output_panoramic_volume = imagedev.dental_unfolding_3d( dental_cbct, dental_fitted_mesh, dental_directions, 15, 3, 4 )

print( "output_panoramic_image:", str( result_output_panoramic_image ) )
print( "output_panoramic_volume:", str( result_output_panoramic_volume ) )
ImageView dental_cbct = ViewIO.ReadImage( @"Data/images/dental_cbct.am" );
IOLink.ArrayXd dental_fitted_mesh = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
dental_fitted_mesh = Data.ReadArrayXd( @"Data/objects/dental_fitted_mesh.arrayxd", dental_fitted_mesh );
IOLink.ArrayXd dental_directions = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
dental_directions = Data.ReadArrayXd( @"Data/objects/dental_directions.arrayxd", dental_directions );

Processing.DentalUnfolding3dOutput result = Processing.DentalUnfolding3d( dental_cbct, dental_fitted_mesh, dental_directions, 15, 3, 4 );

Console.WriteLine( "outputPanoramicImage:" + result.outputPanoramicImage.ToString() );
Console.WriteLine( "outputPanoramicVolume:" + result.outputPanoramicVolume.ToString() );