Automation of Measurements for Personalized Medical Appliances by Means of CAD Software—Application in Robin Sequence Orthodontic Appliances

Measuring the dimensions of personalized devices can provide relevant information for the production of future such devices used in various medical specialties. Difficulties with standardizing such measurement and obtaining high accuracy, alongside cost-intensive measuring methodologies, has dampened interest in this practice. This study presents a methodology for automatized measurements of personalized medical appliances of variable shape, in this case an orthodontic appliance known as Tübingen Palatal Plate (TPP). Parameters such as length, width and angle could help to standardize and improve its future use. A semi-automatic and custom-made program, based on Rhinoceros 7 and Grasshopper, was developed to measure the device (via an extraoral scanner digital file). The program has a user interface that allows the import of the desired part, where the user is able to select the necessary landmarks. From there, the program is able to process the digital file, calculate the necessary dimensions automatically and directly export all measurements into a document for further processing. In this way, a solution for reducing the time for measuring multiple dimensions and parts while reducing human error can be achieved.


Introduction
For the successful treatment of certain conditions, medicine must rely on patientspecific or personalized medical devices. These individualized devices provide support in various indications, from implants (e.g., as used in craniomaxillofacial surgery [1]) to prosthetic and orthotic appliances (e.g., spinal braces and forearm static fixation devices) [2]. A perfect adaptation of the device to the patient's anatomy is essential, not solely for achieving good rehabilitative functioning, but also to avoid complications or side effects (e.g., blistering, ulcers, discomfort) [2]. These devices are produced based on the individual's anatomical information and obtained by different imaging techniques, such as CT-scans for internal body imaging [1] or scanners for body surface imaging [2]. Based on these data, a personalized appliance may be manufactured. Given technological advances, CAD/CAM (Computer-Aided Design and Computer-Aided Manufacturing) technologies are securing their place in the market of personalized devices [3][4][5]. By means of different CAD software, patient-specific devices can be designed and manufactured through different CAM technologies, such as additive (AM) or subtractive manufacturing (SM).
The analysis of such personalized devices is an interesting field of study to further improve treatment. The retrospective study of successfully and unsuccessfully implemented individualized medical appliances can lead to valuable information towards a results, which has been gaining international interest and has been adopted by different centres in recent years [30][31][32][33][34][35][36][37]. These orthodontic appliances are used in newborns and small infants with the objective of relieving upper airway obstruction ( Figure 1A). The appliance consists of a base plate covering the palatal area and a velopharyngeal extension that ends just above the epiglottis ( Figure 1C). This extension needs to be configurated perfectly so that it fits in a position where it is pushing the base of the tongue forward enough to open the airway, but without creating pressure marks on the soft tissue ( Figure  1B). This medical device is based on an intraoral scan of the palatal area [38]. Unfortunately, this scan only provides the shape on which the maxillary is based, leaving the construction of the velopharyngeal extension to the extensive experience of the dental technician and clinician. The appliance is manufactured and the position of the velopharyngeal extension is checked via awake endoscopy [39,40]. This extension will be changed as often as necessary and re-checked using endoscopy until an optimal configuration is obtained. Moreover, patients receive between one and three TPPs, starting at birth, to adapt to their physiological growth. The fitting of the extension relies on a cumbersome and time-consuming process, given that no prior information of the necessary shape and length of the pharyngeal area exists [41]. The delicate situation of these patients prohibits further imaging techniques, such as CT scans or MRI. Moreover, this type of imaging technique will offer a "snapshot" and related measurements of the anatomical parts in a specific time and position (prone or supine). Therefore, personalized TPPs based on this kind of technique, such as the one proposed by Thurzo et al. [42], cannot be considered. As the appliance needs to promote the function alongside the movement of the tongue and pharyngeal area, a visualization method such as an endoscopy is still vital and will be the decisive step towards the acceptance of the appliance for treatment. To ensure the effectiveness of the extension, a polysomnography with a resultant mixed obstructive apnea index of less than three is also imperative [16]. Shape and dimensions of the extension are personalized for each patient, leading to a wide variety of extension dimensions ( Figure 1). This medical device is based on an intraoral scan of the palatal area [38]. Unfortunately, this scan only provides the shape on which the maxillary is based, leaving the construction of the velopharyngeal extension to the extensive experience of the dental technician and clinician. The appliance is manufactured and the position of the velopharyngeal extension is checked via awake endoscopy [39,40]. This extension will be changed as often as necessary and re-checked using endoscopy until an optimal configuration is obtained. Moreover, patients receive between one and three TPPs, starting at birth, to adapt to their physiological growth. The fitting of the extension relies on a cumbersome and time-consuming process, given that no prior information of the necessary shape and length of the pharyngeal area exists [41]. The delicate situation of these patients prohibits further imaging techniques, such as CT scans or MRI. Moreover, this type of imaging technique will offer a "snapshot" and related measurements of the anatomical parts in a specific time and position (prone or supine). Therefore, personalized TPPs based on this kind of technique, such as the one proposed by Thurzo et al. [42], cannot be considered. As the appliance needs to promote the function alongside the movement of the tongue and pharyngeal area, a visualization method such as an endoscopy is still vital and will be the decisive step towards the acceptance of the appliance for treatment. To ensure the effectiveness of the extension, a polysomnography with a resultant mixed obstructive apnea index of less than three is also imperative [16]. Shape and dimensions of the extension are personalized for each patient, leading to a wide variety of extension dimensions ( Figure 1). In this scenario, a retrospective study of the extension dimensions is desirable, as this can be related to clinical factors (such as head circumference), with the objective of standardizing the velopharyngeal extension design in the future and reducing fitting time as well as endoscopic procedures. Moreover, minimum dimensions need to be considered in the introduction of safety margins and quality control for the implementation of new materials and technologies for this treatment [41].
Therefore, this study aims to automatize measurements in personalized medical appliances with anatomic shapes, in this case the TPP, with the ultimate goal of presenting a feasible, fast, accurate and reliable solution to measure TPPs while reducing human interaction and, thus, human error as much as possible.

Sample Digitalization
For this proof-of-concept study, an extraoral scanner (Ceramill Map 400, Amann Girrbach AG, Knoblach, Austria; accuracy 20 µm) was employed to digitize TPP samples. An anonymized and successful TPP employed in a previous study was used as a base [41]. Prior to this, the appliance had been steam cleaned and dusted off with compressed air, followed by a homogeneous application of anti-glare spray (Helling 3D Laser Scanning Spray, Lot# 38580, Helling GmbH, Heidgraben, Germany, particle size. 2.8 µm). The specimen was placed and secured to a holder in the scanning platform by placing modelling clay in the buccal side of the appliance. This allowed the camera module to record the regions of interest, i.e., the palatal area and the extension. A successful scan comprised all regions of interest without any holes or non-recorded regions, as well as no major artefacts surrounding the scan. The sample was exported in a STL (Standard Tessellation Language) format.

Automatization of the Measurement Protocol
CAD software, Rhino 7 and the related Grasshopper 3D (GH), were employed as tools to automate the measurement protocol. Grasshopper is a visual programming language and environment that operates within Rhino 7. This extension allows the use of the modelling tools within the CAD software, as well as the addition of custom-made scripts in different programming languages (C# script, VB script, Python script), in order to control or automate certain complex processes. This is achieved via an algorithmic diagram or workflow. The proposed solution for a standardized and automated measurement is shown in Figure 2. The process starts by selecting and importing an .stl format file of a TPP. The imported mesh file is then processed to allow for a smooth measurement of this part. Later, main orientation planes are created, on which the extension measurements are based. For this, three user-selected landmarks are placed in the base plate. From here, the program will automatically measure all desired dimensions. Later, the user is able to export this set of values, as well as re-start a plate measurement. In the following subsections, more detailed description of the programming clusters for the steps presented in Figure 2 is given.

User Interface (UI) Creation and Editing Tools
The entire UI development process was carried out by the Human UI plugin. These commands were employed for every step within the workflow presented in Figure 2 and can be grouped into three main categories: main commands, UI tools and customization commands.

User Interface (UI) Creation and Editing Tools
The entire UI development process was carried out by the Human UI plugin. These commands were employed for every step within the workflow presented in Figure 2 and can be grouped into three main categories: main commands, UI tools and customization commands.
Main commands ( Figure 3) used for this study were "launch window" for UI window creation, "add elements" for including all UI tools in the user interface and "tabbed view" for sectioning the different parts of the UI in a menu. UI tools are considered those that need to appear in the UI window for user manipulation or outsourcing information. These were added in the main window by "add elements" commands, in this case by organizing them by "tabbed view" (Figure 3). For tool organization, "create grid" and "create expander" commands were employed, whereas "create label" was employed for text addition. "Create button" was employed for cases where user interaction was needed to activate program command lines, as well as to control the process of the measurement process. Activation or non-activation of the button was obtained by a "value listener" command as a true or false value, which was the key component of activation for command parts ( Figure 4). Finally, the most important customization commands employed in this study were "element positioning" (for organization of elements in the UI), "element appearance" (colour, letter size etc. selection for user interface tools) and "custom preview" (colour, trans- Main commands ( Figure 3) used for this study were "launch window" for UI window creation, "add elements" for including all UI tools in the user interface and "tabbed view" for sectioning the different parts of the UI in a menu. UI tools are considered those that need to appear in the UI window for user manipulation or outsourcing information. These were added in the main window by "add elements" commands, in this case by organizing them by "tabbed view" (Figure 3). For tool organization, "create grid" and "create expander" commands were employed, whereas "create label" was employed for text addition. "Create button" was employed for cases where user interaction was needed to activate program command lines, as well as to control the process of the measurement process. Activation or non-activation of the button was obtained by a "value listener" command as a true or false value, which was the key component of activation for command parts ( Figure 4).

User Interface (UI) Creation and Editing Tools
The entire UI development process was carried out by the Human UI plugin. T commands were employed for every step within the workflow presented in Figure 2 can be grouped into three main categories: main commands, UI tools and customiz commands.
Main commands ( Figure 3) used for this study were "launch window" for UI dow creation, "add elements" for including all UI tools in the user interface and "ta view" for sectioning the different parts of the UI in a menu. UI tools are considered t that need to appear in the UI window for user manipulation or outsourcing informa These were added in the main window by "add elements" commands, in this cas organizing them by "tabbed view" (Figure 3). For tool organization, "create grid" "create expander" commands were employed, whereas "create label" was employe text addition. "Create button" was employed for cases where user interaction was ne to activate program command lines, as well as to control the process of the measure process. Activation or non-activation of the button was obtained by a "value liste command as a true or false value, which was the key component of activation for mand parts (Figure 4). Finally, the most important customization commands employed in this study "element positioning" (for organization of elements in the UI), "element appearance" our, letter size etc. selection for user interface tools) and "custom preview" (colour, t parency and other options for displaying elements in the Rhino visualization windo Finally, the most important customization commands employed in this study were "element positioning" (for organization of elements in the UI), "element appearance" (colour, letter size etc. selection for user interface tools) and "custom preview" (colour, transparency and other options for displaying elements in the Rhino visualization window). activated opening of the Windows file explorer ( Figure 4). The command was set so t the files of any user-selected folder will be filtered by the .stl format by default. Once lected, the related file path was used as input for a custom-made C# script command. T script is based on the activation of the Rhino app command window. The custom progr allows for UI button activation of actions, such as importing and resetting of the part lection ( Figure 4).

Mesh Preparation
The imported file was processed to facilitate user manipulation and execution commands within the program ( Figure 5), as well as reduce computing time. For starti creases of the imported files are merged into a mesh by means of the "weld mesh" co mand (default angle = π).

Importing Files
As the first step in the workflow, an .stl file needs to be selected from a folder. For this, the command "Create File Picker" (HU) was employed, which allows for a button-activated opening of the Windows file explorer ( Figure 4). The command was set so that the files of any user-selected folder will be filtered by the .stl format by default. Once selected, the related file path was used as input for a custom-made C# script command. This script is based on the activation of the Rhino app command window. The custom program allows for UI button activation of actions, such as importing and resetting of the part selection ( Figure 4).

Mesh Preparation
The imported file was processed to facilitate user manipulation and execution of commands within the program ( Figure 5), as well as reduce computing time. For starting, creases of the imported files are merged into a mesh by means of the "weld mesh" command (default angle = π).
Thereafter, the command "reduce mesh" was employed to reduce the face count to 3000. This step is necessary to reduce the extra artefacts from the scanner, as well as reduce the number of vertices available for the next landmark selection. The face count was set to maintain the quality and accuracy of the part as high as possible, while reducing the number of vertices, to enable the user to distinguish between these points ( Figure 6). For safety, a "mesh join" command was inserted, so that the program does not recognize all as separate objects but as a single entity, in case the file consists of multiple parts (possibly scanning artefacts). Bioengineering 2022, 9, x FOR PEER REVIEW 7 of 21 Thereafter, the command "reduce mesh" was employed to reduce the face count to 3000. This step is necessary to reduce the extra artefacts from the scanner, as well as reduce the number of vertices available for the next landmark selection. The face count was set to maintain the quality and accuracy of the part as high as possible, while reducing the number of vertices, to enable the user to distinguish between these points ( Figure 6). For safety, a "mesh join" command was inserted, so that the program does not recognize all as separate objects but as a single entity, in case the file consists of multiple parts (possibly scanning artefacts).
For improvement of the visualization of the object, the part was located in the middle of the visualization board by moving ("come to point" command) the first triangle centre point ("face normal" command) to the origin (0, 0, 0) of the coordinate system. Display colour, textures and reflection were defined for the face boundaries and the solid colour of the part by "custom preview". As setup, a custom material was created to ensure a lack of transparency and provide a good contrast of the deep valleys and peaks within the palatal plate area (Figure 6), which was necessary for landmark selection.
Finally, the centres and vertices of the mesh triangles were baked ( Figure 6). Baking is understood as the translation of a fictional visualization into a physical object in the main Rhino display interface, without which the manual manipulation, edition or selection of parts in the main Rhino program will not be possible. That is, the part only exists in the GH environment until baking allows for its translation to the main program. Bioengineering 2022, 9, x FOR PEER REVIEW 8 Figure 6. Example of the reduction of mesh face count. Before processing (top), the part con of 165,000 faces, and after processing (bottom), the value was decreased to 3000. The large n of face centres and vertices (baked Rhino objects as white points) makes selection of landmar the visualization of the part difficult.

Landmark Selection
As the face centres and vertices were baked beforehand, these objects can be m ulated in the main Rhino visualization window by the user. The main user intera comes from the selection of the landmarks from where the complete measuremen planned. For that, four landmarks were defined (Figure 7): incisive papilla (IP), end For improvement of the visualization of the object, the part was located in the middle of the visualization board by moving ("come to point" command) the first triangle centre point ("face normal" command) to the origin (0, 0, 0) of the coordinate system. Display colour, textures and reflection were defined for the face boundaries and the solid colour of the part by "custom preview". As setup, a custom material was created to ensure a lack of transparency and provide a good contrast of the deep valleys and peaks within the palatal plate area (Figure 6), which was necessary for landmark selection.
Finally, the centres and vertices of the mesh triangles were baked ( Figure 6). Baking is understood as the translation of a fictional visualization into a physical object in the main Rhino display interface, without which the manual manipulation, edition or selection of parts in the main Rhino program will not be possible. That is, the part only exists in the GH environment until baking allows for its translation to the main program.

Landmark Selection
As the face centres and vertices were baked beforehand, these objects can be manipulated in the main Rhino visualization window by the user. The main user interaction comes from the selection of the landmarks from where the complete measurement was planned. For that, four landmarks were defined ( Figure 7): incisive papilla (IP), end of the tuber maxilla area (Q1, Q2) and the end part of the extension (end). These were selected as they are the most visible or recognizable for the user, and they are constant elements to be found in every fabricated appliance. The deepest areas of the palatal area were used for the selection of IP, Q1 and Q2, which enables distinguishing between the custom materials placed in the previous step. IP consisted of the most forward and deepest point, whereas Q1 and Q2 reflected the most backward and deepest points. The end point consisted of the deepest vertice point. Figure 6. Example of the reduction of mesh face count. Before processing (top), the part co of 165,000 faces, and after processing (bottom), the value was decreased to 3000. The large n of face centres and vertices (baked Rhino objects as white points) makes selection of landma the visualization of the part difficult.

Landmark Selection
As the face centres and vertices were baked beforehand, these objects can be m ulated in the main Rhino visualization window by the user. The main user inter comes from the selection of the landmarks from where the complete measureme planned. For that, four landmarks were defined ( Figure 7): incisive papilla (IP), end tuber maxilla area (Q1, Q2) and the end part of the extension (end). These were se as they are the most visible or recognizable for the user, and they are constant elem be found in every fabricated appliance. The deepest areas of the palatal area wer for the selection of IP, Q1 and Q2, which enables distinguishing between the custo terials placed in the previous step. IP consisted of the most forward and deepest whereas Q1 and Q2 reflected the most backward and deepest points. The end poin sisted of the deepest vertice point.  In Figure 8, the code part for the selection of the IP is shown. The key command was created by a C# script, where a button activation allowed the selection or deselection of a point within the measured part to be carried out. The same command structure was employed for the remaining landmarks.
A control tool was included to verify that all landmarks were selected and, therefore, that the process could continue. If the geometries were not stored, a true value was obtained through the command "null item". A child window of the main UI was created where the user can check for the completeness of the selection. In Figure 8, the code part for the selection of the IP is shown. The key command was created by a C# script, where a button activation allowed the selection or deselection of a point within the measured part to be carried out. The same command structure was employed for the remaining landmarks. A control tool was included to verify that all landmarks were selected and, therefore, that the process could continue. If the geometries were not stored, a true value was obtained through the command "null item". A child window of the main UI was created where the user can check for the completeness of the selection.

Automated Measurement
By employing the selected landmarks, a main base plane (MBP) was constructed. This was employed to divide the extension in between the "effective" and "cleft" extension (Figure 9), with the former being the main part responsible for the airway opening as it is in contact with the tongue base, whereas the latter is influenced by the shape of the cleft area, as well as employed dental technique. Different measurements were carried out to interpret the dimensions of the measured part. A summary of the employed construction and measurement names for the different sections, as well as their meanings, is shown in Table 1.

Automated Measurement
By employing the selected landmarks, a main base plane (MBP) was constructed. This was employed to divide the extension in between the "effective" and "cleft" extension ( Figure 9), with the former being the main part responsible for the airway opening as it is in contact with the tongue base, whereas the latter is influenced by the shape of the cleft area, as well as employed dental technique. Different measurements were carried out to interpret the dimensions of the measured part. A summary of the employed construction and measurement names for the different sections, as well as their meanings, is shown in Table 1. Parallel planes to the base plane were constructed to create sectional planes within the extension (Figure 9). A total of five sectional planes were performed along the extension. Here, sectional curves (S1-S5) and their respective centroids (PS1-PS5; centre points of the sectional area) were calculated by the "curve and plane" component ( Figure 10). From the centroid of the sectioning curve, two additional planes were created, which were perpendicular to the curve sectioning plane, as well as to each other (i.e., Section 4 in Figure 9; width plane PW-S4, thickness plane PT-S4;). From where the planes cut the sectional curves, intersection points were obtained (i.e., PS4-1 to PS4-4 for Section 4). In this way, the distance between the width (i.e., distance PS4-1 to PS4-2) and thickness (i.e., distance PS4-3 to PS4-4) of this sectional part could be obtained (Figures 9 and 10). In addition, the area of the curve was obtained by the "area" command. While the same procedure was used for all sections along the effective length of the extension, a different one was employed for the cleft side extension (Figure 9). This portion of the device is the one most influenced by the technician's manufacturing, and, despite its shape, is less related to the opening of the airway; this section is comprised of the most extreme values of thickness and width. Thinner and narrower structures are often found to avoid pressure marks and aid physiological soft palate movements. Such values are interesting, as they are key information for the assessment of the quality of the device, as well as for preventing its breakage and respective complications. Therefore, an extra  Parallel planes to the base plane were constructed to create sectional planes within the extension (Figure 9). A total of five sectional planes were performed along the extension. Here, sectional curves (S1-S5) and their respective centroids (PS1-PS5; centre points of the sectional area) were calculated by the "curve and plane" component ( Figure 10). From the centroid of the sectioning curve, two additional planes were created, which were perpendicular to the curve sectioning plane, as well as to each other (i.e., Section 4 in Figure 9; width plane PW-S4, thickness plane PT-S4;). From where the planes cut the sectional curves, intersection points were obtained (i.e., PS4-1 to PS4-4 for Section 4). In this way, the distance between the width (i.e., distance PS4-1 to PS4-2) and thickness (i.e., distance PS4-3 to PS4-4) of this sectional part could be obtained (Figures 9 and 10). In addition, the area of the curve was obtained by the "area" command. Moreover, sagittal and effective lengths were obtained. These comprise distances of the sagittal and effective length directions for every single centroid (PS0-PS5) ( Figure 11). For that, centroids were projected to the main base plane (Figure 12; i.e., PS4 projected to the main base plane becomes PS4-P). The distance between the centroids and their projection was recorded as the effective length, whereas the distance between PI and the projected point was recorded as sagittal length (Figure 11). While the same procedure was used for all sections along the effective length of the extension, a different one was employed for the cleft side extension (Figure 9). This portion of the device is the one most influenced by the technician's manufacturing, and, despite its shape, is less related to the opening of the airway; this section is comprised of the most extreme values of thickness and width. Thinner and narrower structures are often found to avoid pressure marks and aid physiological soft palate movements. Such values are interesting, as they are key information for the assessment of the quality of the device, as well as for preventing its breakage and respective complications. Therefore, an extra section (S0) was implemented in this region (Figure 9) following the same protocol. Instead of sectional planes parallel to the base plane, perpendicular ones were created along the cleft extension, dividing it in five equal segments. Areas of these sections were compared, selecting the smallest one as "Section 0" (S0) (Figure 9), or as the area where the most extreme values happened. Thickness and width for this area were also recorded by employing the procedure explained above (Figures 9 and 10).
Moreover, sagittal and effective lengths were obtained. These comprise distances of the sagittal and effective length directions for every single centroid (PS 0 -PS 5 ) (Figure 11). For that, centroids were projected to the main base plane (Figure 12; i.e., PS 4 projected to the main base plane becomes PS 4 -P). The distance between the centroids and their projection was recorded as the effective length, whereas the distance between PI and the projected point was recorded as sagittal length (Figure 11). Moreover, sagittal and effective lengths were obtained. These comprise distance the sagittal and effective length directions for every single centroid (PS0-PS5) ( Figure  For that, centroids were projected to the main base plane (Figure 12; i.e., PS4 projecte the main base plane becomes PS4-P). The distance between the centroids and their pro tion was recorded as the effective length, whereas the distance between PI and the jected point was recorded as sagittal length (Figure 11).  For the extension inclination description, angles along the curve were calculated. Lines were created by connecting the centroids (command "line", Figure 12), creating a skeleton of the extension (Figure 11). Angles in between lines were calculated in a clockwise direction. For the first main angle, the incisive papilla (IP) was connected to the first centroid (PS 1 ), as this is where the major bending of the structure occurs ( Figure 11). Moreover, effective extension volume was calculated for the effective extension segment (V eff ), by the command "volume".
For the extension inclination description, angles along the curve were calculated. Lines were created by connecting the centroids (command "line", Figure 12), creating a skeleton of the extension (Figure 11). Angles in between lines were calculated in a clockwise direction. For the first main angle, the incisive papilla (IP) was connected to the first centroid (PS1), as this is where the major bending of the structure occurs ( Figure 11). Moreover, effective extension volume was calculated for the effective extension segment (Veff), by the command "volume".

Exporting of Values
For exporting the measured values, the command was prepared so that values could be exported in a .csv format with a user-given name and a user-selected folder. The user name was obtained by a "text box" HU command, and a "file picker" was used to gather the folder location. This information was combined to the expected format (.csv) by the "concatenate" command. This information was followed by a VB custom script ( Figure  13), which is responsible for the export action. This action was again tied to a user-activated UI button. As a control tool, a child window was placed to notify the user in case an export of an empty .csv file is attempted, which was identified by using "null item" when receiving the data in the VB script.

Exporting of Values
For exporting the measured values, the command was prepared so that values could be exported in a .csv format with a user-given name and a user-selected folder. The user name was obtained by a "text box" HU command, and a "file picker" was used to gather the folder location. This information was combined to the expected format (.csv) by the "concatenate" command. This information was followed by a VB custom script (Figure 13), which is responsible for the export action. This action was again tied to a user-activated UI button. As a control tool, a child window was placed to notify the user in case an export of an empty .csv file is attempted, which was identified by using "null item" when receiving the data in the VB script.
For the extension inclination description, angles along the curve were calculated. Lines were created by connecting the centroids (command "line", Figure 12), creating a skeleton of the extension (Figure 11). Angles in between lines were calculated in a clockwise direction. For the first main angle, the incisive papilla (IP) was connected to the first centroid (PS1), as this is where the major bending of the structure occurs ( Figure 11). Moreover, effective extension volume was calculated for the effective extension segment (Veff), by the command "volume".

Exporting of Values
For exporting the measured values, the command was prepared so that values could be exported in a .csv format with a user-given name and a user-selected folder. The user name was obtained by a "text box" HU command, and a "file picker" was used to gather the folder location. This information was combined to the expected format (.csv) by the "concatenate" command. This information was followed by a VB custom script ( Figure  13), which is responsible for the export action. This action was again tied to a user-activated UI button. As a control tool, a child window was placed to notify the user in case an export of an empty .csv file is attempted, which was identified by using "null item" when receiving the data in the VB script. Figure 13. GH commands for measurement export. Background colour coding: Conventional GH commands (purple), custom script (red). Figure 13. GH commands for measurement export. Background colour coding: Conventional GH commands (purple), custom script (red).

Re-Starting of the Program
Once all the steps of the workflow are performed, the measurement program can be restarted. For that, a C# script was employed. This script was used to activate the Rhino interface command window, where the commands were given for selecting and eliminating all objects from the display interface. The script was setup to be activated by a UI activation button.

Case Study and Measurement Example
Three different TPP case scenarios were employed to test the functioning of the proposed program. The three cases corresponded to different clinical pictures (Table 2). This was approved by the institutional ethics committee of the University Hospital Tübingen (approval number: 455/2019BO2) and was performed according to the Declaration of Helsinki in its current version. Case A was based on a newborn who received the first plate, which is expected to be small. Case B and C corresponded to two patients of similar age and size who received their second plate. The three cases were used to test the program for measuring slighter extension configurations as a means to compare cases that should be more similar theoretically.

Performance of the Measuring Program and UI
By means of the UI, the user was able to follow the workflow steps in order by clicking on the different tabs. By default, the first tab is always open when initializing the program. The UI provided explanatory text and pictures to guide the end user throughout the process. In the first step (Figure 14), the user was able to choose an .stl from any folder in the device by the "open file" button. The selection was confirmed by the button "import file", and in case of importing a wrong file, the import could be eliminated by the "reset" button. Next, by activating the second tab ("prepare mesh"), the user needed to give permission for the mesh processing by a button activation ("bake") ( Figure 14). This permission allowed for the largest computer processing to be activated. The user needed to press it when the imported file was the suitable one, so that processing time could be saved in case of an incorrect selection, in contrast to processing directly and without user permission after the file import. Later, the landmarks for the measurement basis and orientation were placed by the user. For that, the user was required to activate the landmark selection in the UI and subsequently select the appropriate vertices or point related to the landmark (Figure 15). The selection was carried out in the main Rhino visualization window, where the selected Later, the landmarks for the measurement basis and orientation were placed by the user. For that, the user was required to activate the landmark selection in the UI and subsequently select the appropriate vertices or point related to the landmark (Figure 15). The selection was carried out in the main Rhino visualization window, where the selected point would turn green. The selected point could be eliminated and the selection process carried out again by the button "eliminate". Moreover, the user could activate a control window by the "selection control" button, which allowed a feedback about the completeness of the selection procedure and identifying which point selection was missing. This control step was important to establish, as the measurement could only be executed by selecting four landmarks. Once the selection was completed, all points, lines, planes, etc. needed for the measurement were automatically created.  In the tab "measurement export", the user could define a file name and a folder for export. By selecting the "export" button, all measured values will be exported into a .csv document. In case any landmark has been eliminated or the measuring process has not been activated, the program will execute an error window ( Figure 16) informing about the export of an empty document. Finally, the user could activate the button in the re-start tab (Figure 16), and all of the performed changes and processes can then be eliminated, setting the program to default mode. The user can re-start the process with a new measuring file in the first tab. For more detailed insight into the functioning of the proposed program, see the supplementary data. Figure 15. User interface view for the "landmark selection" and "selection control panel" for the completeness control of the process. Figure 16. User interface view for the tabs of "measuring export" (left) and "re-start" (right). For an uncompleted measurement protocol or export document, a warning window appears (right). Figure 16. User interface view for the tabs of "measuring export" (left) and "re-start" (right). For an uncompleted measurement protocol or export document, a warning window appears (right).

Results of Case Study
A total of 32 values could be obtained from three different TPPs (Table 3). All values were based on the reference placed by the selected landmarks and were automatically exported. Diverse extension configurations were measurable, and differences in measurements results could be identified. Large dimensional differences were observed between case A and the other cases, for example for EL and SL (Table 3, Figure 17). Minimum width and thickness values were recorded in the cleft extension of case A, which were almost half the recorded values in B and C. Similar values for the first angle (α 1 ) were obtained for all scenarios. For cases B and C, differences in effective length and sagittal length were already perceptible visually (Figure 17), but a quantification of the difference between plates could be obtained through the program. For example, the EL 5 differed by 10 mm, whereas the SL 5 differed by 8 mm. In this way, case C had a more frontally positioned and longer velopharyngeal TPP extension than case B.  Table 2). Images are to scale and thus, show the real-life dimensional differences between the different TPPs.

Discussion
In this study, a methodology to automatize measurements of personalized medical appliances with anatomic shapes is proposed. In particular, the study provides a solution for measuring orthodontic appliances known as the TPP, where parameters such as length, width and angle could help to standardize and improve treatment in the future.
While the shape of the TPPs could not be evaluated and measured manually with common methods, such as callipers, the proposed program proved to be useful for this goal. It was possible to measure and compare real TPPs, where small differences in the velopharyngeal extension could be quantified. A complete picture of the morphology of the extension was obtained, independent of its configuration.
Given the nature of the production of the TPP, as well as the proposed methodology, it has the same problems with landmark extraction and measurements as seen in medical imaging techniques [6]. For example, the difficulty in quantifying the accuracy of the landmark selection and its measurement is also related to the employed rater. This is because fully automated systems for 3D model measurements cannot yet be obtained in medical imaging. Individual variations in shape and distortions from the normal shape, represented by malformations or other issues, render complete automation difficult [6].
While medical disciplines still rely on the identification of landmarks for measurement purposes, new technologies have the potential to enhance this process by reducing employed time and improving the reliability of the measurements [6,10]. In this way, clinically relevant distance and angle measurements, as well as shape analysis and comparison, can be simplified. In the current study, the three landmarks from the base plane affect the orientation of the plane. Nonetheless, the effect is expected to be low. Even with a  Table 2). Images are to scale and thus, show the real-life dimensional differences between the different TPPs.

Discussion
In this study, a methodology to automatize measurements of personalized medical appliances with anatomic shapes is proposed. In particular, the study provides a solution for measuring orthodontic appliances known as the TPP, where parameters such as length, width and angle could help to standardize and improve treatment in the future.
While the shape of the TPPs could not be evaluated and measured manually with common methods, such as callipers, the proposed program proved to be useful for this goal. It was possible to measure and compare real TPPs, where small differences in the velopharyngeal extension could be quantified. A complete picture of the morphology of the extension was obtained, independent of its configuration.
Given the nature of the production of the TPP, as well as the proposed methodology, it has the same problems with landmark extraction and measurements as seen in medical imaging techniques [6]. For example, the difficulty in quantifying the accuracy of the landmark selection and its measurement is also related to the employed rater. This is because fully automated systems for 3D model measurements cannot yet be obtained in medical imaging. Individual variations in shape and distortions from the normal shape, represented by malformations or other issues, render complete automation difficult [6].
While medical disciplines still rely on the identification of landmarks for measurement purposes, new technologies have the potential to enhance this process by reducing employed time and improving the reliability of the measurements [6,10]. In this way, clinically relevant distance and angle measurements, as well as shape analysis and comparison, can be simplified. In the current study, the three landmarks from the base plane affect the orientation of the plane. Nonetheless, the effect is expected to be low. Even with a selection deviation of 0.5-1 mm in the landmark, the plane's orientation would not change significantly enough to cause a major disruption in the sectioning of the extension and the respective measurements. The largest effect is expected on the calculation of the sagittal length, as a more forward selection of the papilla will result in a longer sagittal length. When compared to any conventional measurement method, such as the use of a calliper, selecting the same exact point for a landmark for every single measurement is done only once. This means that the landmark does not need to be reselected for every measurement. Conventionally, it will need to be re-selected, adding a new random error to the measurement, whereas with an automated program, the landmark stays constant across all measurements. As a benefit to the operator, this reduces the occurrence of errors and improves other aspects, such as measurement duration.
When it comes to software selection, the combination of Rhinoceros and Grasshopper proved to be a user-friendly solution through the help of its visual programming environment. Despite the user needing a basic knowledge of CAD measurement processes and their related workflow, an automation process, as well as a user interface, can be created with comparatively little investment and time. The process is further simplified thanks to the UI, as it allows further use of the program for clinical staff without CAD or programming knowledge. This can be a major advantage when implementing measurement automation for smaller projects or research niches, such as in the current study, in both medicine and other fields [11]. The development of more sophisticated self-developed programs for measuring, with an improved user interface or executable programs, as well as the inclusion of techniques such as machine learning and artificial intelligence, is not applicable for such small projects. Increased time, investment and human resources cannot be easily justified for research performed for diseases with low prevalence, as it has only low commercial potential.
Regarding the clinical relevance, the proposed measurement methodology can be used to gather information on successfully used plates and their relationship to the clinical picture. This could then be employed for the creation of guidelines to further standardize TPP production for different patients, which could potentially reduce the fitting time or endoscopic procedures, as well as reduce the workload in the orthodontic dental laboratory. Moreover, it would provide inexperienced centres interested in adopting the TPP treatment with some orientation for treating their patients that could facilitate its implementation. Eventually, the developed program could act as a bridge for future design and production of TPPs, as well as improvement of the therapy. Additionally, this kind of methodology could successfully be applied in other fields of personalized devices, as the employed software proved to be easy to develop and the commands offer a variety of options for automated measurement. Its successful adaptation in the remaining applications is mostly dependent on the possibility for landmark or specific structure detection for the referencing of the part.
To mention some limitations of this study, a completely autonomous measuring procedure was not possible to obtain, as some level of user interaction is necessary and, therefore, a user influence on the obtained values cannot be avoided. Regardless of the few landmarks employed, while minimal, an error in the recorded values can be expected. Optimization of the program can be expected after measuring a larger set of TPPs, in order to address and measure a wider range of possible TPP modifications and scenarios. Moreover, a successful scan meeting all of the mentioned requirements is a necessity, where all of the identifiable landmarks and areas to be measured can be identified. Artefacts can make the processing and further measurement of the sample more difficult, as well as increase the chances of program crash.

Conclusions
In summary, this work focused on proposing a methodology that exploits the potential of CAD technologies for automating the measurement of individualized devices with complex anatomical shapes. A custom-program based on Rhinoceros 7 and Grasshopper was presented to measure an orthodontic appliance employed for Robin sequence treatment, known as the Tübingen Palatal Plate (TPP). The program proved to be useful for the measurement and comparison of real TPPs, where small differences in the velopharyngeal extension could be quantified successfully. In this way, measurement time and human error were reduced, while offering a wide range of measurements describing the shape of the extension of the appliance. Further studies need to evaluate the relationship between the device's physical dimensions and clinical parameters in order to further optimize this treatment, as well as establish a guideline that serves to shorten the fitting of the TPP for different clinical pictures. This measuring methodology could ultimately be used for the completeness of clinical records and the improvement of the therapy.