Interactive reconstructions of cranial 3D implants under MeVisLab as an alternative to commercial planning software

In this publication, the interactive planning and reconstruction of cranial 3D Implants under the medical prototyping platform MeVisLab as alternative to commercial planning software is introduced. In doing so, a MeVisLab prototype consisting of a customized data-flow network and an own C++ module was set up. As a result, the Computer-Aided Design (CAD) software prototype guides a user through the whole workflow to generate an implant. Therefore, the workflow begins with loading and mirroring the patients head for an initial curvature of the implant. Then, the user can perform an additional Laplacian smoothing, followed by a Delaunay triangulation. The result is an aesthetic looking and well-fitting 3D implant, which can be stored in a CAD file format, e.g. STereoLithography (STL), for 3D printing. The 3D printed implant can finally be used for an in-depth pre-surgical evaluation or even as a real implant for the patient. In a nutshell, our research and development shows that a customized MeVisLab software prototype can be used as an alternative to complex commercial planning software, which may also not be available in every clinic. Finally, not to conform ourselves directly to available commercial software and look for other options that might improve the workflow.


Introduction
Cranioplasty, were a defect or deformity of the cranial bone is repaired [1], is often performed because of traumas, infections, tumors or compressions due to brain edema [2]. Even though the method is relatively safe, global intracerebral infarction can cause lethal results [3]. It is also possible, that further complications occur resulting in a loss of the cranial implant. Brommeland et al. [4] for example, showed that out of 87 patients, 37 (36%) suffered from complications, whereby even 22 lost their primary implant. The most common causes were surgical site infections, affecting eight patients (9.2%) and bone flap resorption in fourteen patients (19.7%). Furthermore, there is a broad range on different used materials to close the defect, like acrylic [5] as a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 one of the most used ones or composite materials like hydroxyapatite-poly(methylmethacrylate) (PMMA) composites [6]. Nevertheless, using autologous bone is still considered the gold standard, but methods using osteointegration were synthetic porous implants guide the bone regeneration, call for an urgent need as well [7]. Since no cranial defect looks like the other, patientindividual implants are in general needed for a successful and precise treatment. This usually requires a careful pre-operative planning on the basis of a Computed Tomography (CT) scan of the patient's skull and the design of an exact virtual 3D model of the implant (Fig 1) [8]. However, constructing a virtual model of a cranial 3D implant is a challenging task, which often lacks of appropriate software that can be applied in the pre-planning phase. One option are commercial software products, like MIMICS, Biobuild or 3D doctor, which tend to be very complex and expensive, and hence, they are not available in every clinic. Another option is to use (free) non-medical software, like the 3D computer graphics software Blender (https://www. blender.org/), to create an implant computer model. However, due to the fact that these software tools are not intended to create medical implants and don't offer specific and convenient tools for these tasks, the design process can take up to several hours. This is mainly the case, because vertex after vertex has to be pulled into position by simple drag and drop operations. Obviously, this course of action is not a very user-friendly way to reach a satisfying result.
Other working in the area of computer-aided cranioplasty are Lee et al. [9], who present a custom implant design case for an 8-year-old boy with a large cranial defect. The raw cranial CT data of the patient was translated into the stereolithography (STL) format utilizing a computer-aided manufacturing/computer-aided design (CAM/CAD) interface software tool. Anyhow, Lee et al. do not state which CAM/CAD software tool they applied or describe it in further detail. Van der Meer and colleagues [10] present the digital planning of cranial implants for the reconstruction of skull defects. However, the overall workflow is very timeconsuming and includes the usage of a generic industrial software. The software offers automated procedures and functions like "curvature-based filling" and "fill holes" that have been applied to design the final implant model. Chulvi et al. [11] demonstrate the automated generation of customized implants by linking two computer software prototypes. Thereby, a Knowledge Based System technology is the core of the model. On one side, it is able to manage and store medical data, on the other side, it is able to manage and store designer knowledge. Afterwards, this information is used for the implant design process and the research findings are based on previous studies of existing software tools, like MIMICS, 3D Slicer [12], ImLib3D, MITK, OsiriX and the Visualization Toolkit (http://www.vtk.org/). Another proposed method from Lo et al. [13] uses the mirrored healthy side of the skull as a template combined with further, time intense, optimization using the AnalyzeTM software. A CAD tool for the custom implant design for large cranial defects (>100 cm 2 ) has recently been published by Marreiros et al. [14]. The approach uses a combination of geometric morphometrics and radial basis functions for the semi-automatic implant generation. Further, the method uses symmetry and the best fitting shape to estimate missing data directly within the radiologic volume data. Finally, reconstructions of skulls like presented in [15] and [16] are not based on the mirroring technique, rather they use shape models to close the defects, which means that this work is mainly for areas where "simple" surface parts have to be reconstructed. However, according to Gilardino et al. [17], the usage of current computer-aided pre-planning systems is still quite time-consuming, but they reduce the number of following complications significantly and some softwares allow already wizard-wise packages and the creation of macro's, which can help to reduce the planning time.
In this contribution, we developed a planning prototype for 3D cranial implants within the freely available medical research platform MeVisLab (http://www.mevislab.de/) [18]. To the best of our knowledge, this is the first time cranioplasty has been introduced to the MeVisLab platform. We decided for the semi-commercial platform MeVisLab, because it is currently more stable and user friendly than the pure open source platforms, like Slicer or the two MITK toolkits (www.mitk.org/ and http://www.mitk.net/ from Germany and China). In summary, our method uses the mirrored skull as a template for generating a good fitting and aesthetic looking implant. Fitting in terms of no gaps between the bone and the implant. However, since surgeons have an interest in modifying the implants individually to a certain level, we did not design a fully-automated system performing all operations without any user interaction. Rather, the user can manually intervene in every step for specific modifications of the implant. Finally, the implant model can be stored as STL file to be used with 3D printing technology [19]. As audience for this contribution, we want primarily to target clinical/biomedical end users of our prototype. However, we also try to target researches that may want to build upon our solution. Thus, we also provide a more detailed technical description and code-sections like the paragraphs concerning the "Smoother module". We hope that the technical description makes it easier to understand the network/module and enables extensions for further features.
This contribution is further organized as follows. Section 2 depicts details of the used material and the newly proposed integration, presents the theoretical background of the proposed mechanism and provides sufficient detail to allow the work to be reproduced. In Section 3, experimental results, including illustrations of generated implants, are presented. Section 4 gives a summary together with a short discussion to highlight the significance of the introduced achievement and lays the foundation for further work.

Material and methods
Datasets-The datasets used for evaluating our software were stored in STL format, originally derived from CT scans with average slice thicknesses of 1 mm (the transformation from CT/ DICOM data to STL can be done for example with the WEMIsoSurface module available under MeVisLab). However, there was no more information about any of the used files since they were only provided in STL-format from the clinical partners for anonymization purposes. In addition, the lower part, or more precisely, the mouth region, was removed from the skull to make it impossible to recognize the patients via their teeth. For testing our pre-planning tool, a variety of patient skulls, suffering from cranial defects, with variations in anatomy and location of the pathology, were made available from our clinicians. The defects ranged from small to bigger ones, like from the central, frontal bone to the dextral ethmoidal bone without affecting the orbital bow or a bigger cranial defect on the sinister parietal bone. Some of the cranial/skull defect datasets are freely available online for download in the anonymized STL format. The datasets can be used for own research purposes, but we kindly ask to cite our work [20]. All relevant data are hosted at the public repository Figshare. Please see data hosted at Figshare at the following URL: https://figshare.com/articles/Cranial_Defect_Datasets/4659565 Note: when more datasets get available over time or other researchers provide us new cases, we will add them to the database. Furthermore, our data collection includes the software network (note that our software prototype is not a FDA/CE-certified application). Finally note that the original CT data can allow a finer review of a generated implant, e.g. checking the fitting, measuring the bone thickness for the fixation screws and checking the mirroring based on a self-defined midsagittal plane. However, if someone has own CT data, (s)he can also load it into the network and overlay it with the planned implant for a finer review of the results as mentioned before.
Workflow overview-We implemented a MeVisLab network in this contribution that uses manually set markers and a mirrored skull to generate a first curvature template for the defected area. Additionally, Delaunay-Triangulation [21] is used to construct a triangulated mesh via manually placed markers. Furthermore, we implemented a custom created smoother-module that rearranges the markers based on Laplacian-smoothing, which is a common and well-fitting method to smooth a generated mesh [22], [23]. This helps to avoid hard edges and generates a smooth and more aesthetic looking implant. The next sections describe the network and its modules in more detail.
Network-In Fig 2 the constructed network, created within MeVisLab, is shown. Each block represents a module with different functions. Beside already pre-defined modules, offering basic and advanced algorithms, the platform also provides an interface for the implementation of new modules using C++. The different colors represent different types of modules, where blue ones process WEM data, green modules mark an Open Inventor module, working with visual scene graphs (3D) and last, the brown ones, hiding sub networks formed by the other modules. To connect the modules with each other, again, two different connector types are available: The undirected lines, for a data connection and the directed ones, indicated by the arrow, for a parameter connection. When it comes to the inputs/outputs, one can distinguish between three types: The squared for Base-objects, pointing to data structures, the triangulated for ML images and the half-circled, for Inventor scenes. With the introduced modules and connections, the network was set up, consisting of four main parts: 1. Skull modify-This section loads the dataset once and handles its preparation. The user can apply transformations in form of rotation, translation, applying a transform matrix and much more. Further, the skull can be cut with a plane, where just one side of this plane will be visible. This option is necessary to get a view on the inner parts of the skull, for example, the inner edges. The output is a modified skull.
2. Mirrored skull modify-This section holds exactly the same network components as the one described before. However, it has its purpose in preparing the second dataset, which is mirrored and thus serving as a template. An example is presented in Fig 3, which also shows that pure mirroring without further processing is not sufficient to generate an implant. The reason is, that human skulls are in general to asymmetric and therefore an implant resulting from pure mirroring has in most cases to be further adapted and refined. Further note that in general the exact midsagittal plane cannot be determined without the CT data. In our software an initial (mid)sagittal plane is defined via the nose and the eye sockets. Then, the user can make refinements by interactively reposition the plane and at the same time observing the outcome on the defected side. However, if an user has own cases with the CT data available, (s)he can overlay the data in our software and use this additional information to define the exact midsagittal plane.
3. XMarker-In this part all marker operations are handled, from setting the markers, storing them and performing modifications, until finally converting them from an (MeVisLab) MLBase type to vtkPoints.
4. vtk-This section uses only modules based on the vtk library, like the calculation of the Delaunay-Mesh with vtkDelaunay3D and has its purpose in generating the triangulated mesh and saving the data, respectively the final implant in STL format for 3D printing.
Implant Generation Pipeline-The workflow pipeline can be separated in three big parts, almost according to the four main network groups. Fig 4 gives an illustrative description, which is further described in the following sections. Dataset preparation: Original skull, mirrored skull (Fig 4, upper block) First, by clicking on the left WEM load module in the skull modify section, the path to the file is chosen where the skull with the cranial defect is stored. Second, the WEM modify module is used for centring the data set in world coordinates. With the skull plane viewer module the user is able to cut the dataset with a plane, thus allowing to view the defect also from the inside. Since the data is used twice in the network, the dataset has also to be loaded in the mirrored skull modify section, where it serves as a template. Same actions need to be performed with this dataset and additionally in the WEM modify module a mirroring operation has to be performed by applying the appropriate transformation matrix. This matrix is a diagonal matrix where the first entry is inverted. Fig 5 shows the result of these preparation steps where the white part illustrates the original and cut dataset and the green part the mirrored skull.
Marker setting (Fig 4, middle block) The first step in this section is to set markers on the edge of the defect. Next, a connection from the first WEM renderer to the 3D marker editor has to be established, which will enable to set markers on the surface of the original skull. Overall, we have four marker types: outer edge, inner edge, outer surface and inner surface, which are differentiate by their marker types (values zero to three) in the marker editor options panel. In the viewAll viewer, it is now possible to set the markers along the outer edge of the defect. Next, the marker type has to be changed from zero to one and the inner edge markers on the original skull's surface are set (note: using the cut plane option from skull modify). Before being able to set the outer surface markers, a connection from second WEM renderer in the mirrored skull modify section to the 3D marker editor is established. Furthermore, it is necessary to connect the mirrored skull to the view all viewer. If the marker type is set to two, the network is ready for setting markers on the mirrored surface. However, further improvements can be achieved by using the translation operations in the WEM modify module or by setting markers just in regions where the surface fits already perfectly. Then adjusting the mirrored skull by translating it again, so that other regions fit perfectly, and set additional markers on the surface. The final step it to set the inner surface markers, the same way as it was done with the outer surface markers but instead using the marker type three. Final adjustments save/load (Fig 4, lower block) After the triangulation has been performed, adjustments can be applied to gain an even better looking implant. By clicking/opening the smoother module, the radius (x) as well as the weight of the edge markers (y) can be adjusted to improve the implant by smoothing it. In addition, the characteristics of the vtk Delaunay 3D module can be adjusted as well, to improve the outcome by changing its parameters. Finally, the marker list can be saved and loaded at any time, as well as the generated implant in the STL file format.
Smoother Module-Since the smoother module was a new implementation, the following lines together with the flow chart in Fig 6 give a rough description of the module and how it works and how it was set up. First, a ML module was set up using one input, one output and two field variables serving as user input. The header file of the module's C++ data is set up in a standard way (except the inclusion of the vector library), consisting of a constructor, a method for handling the changes of the fields and the definitions of the input and output marker lists, using base field pointers. The parameters x and y are set as integer field pointer variables and a flag that shows if parameters have changed, and an internal storage of a marker-list are also used. Having a look at the source file, we first implemented the constructor, by giving it zero inputs and zero outputs from MeVisLab's point of view, which is actually not true, since we handle the inputs and outputs with the base field pointers, declared before. During setting up the constructor, the handle notification method is disabled. More, the field parameters are set up, as well as the base outputs for the marker lists. In the implementation of the handle notification method, we first check for the parameters value to be more than zero or one. Next, it is checked if the parameters have changed. If so, the output list is cleared and the input is checked for validity. Further, the operation is dismissed if the list consists of less than three markers. Otherwise, the input list is copied to the internal marker list to start the actual algorithm, which can be observed in the code snippet in Fig 7. In more detail, the code snippet begins with iterating over all nodes (markers). If the current node is an edge marker, nothing is done, since those are already fixed in position (1). Otherwise, it is iterated over all nodes again to calculate the distance between the current node and all other nodes (2). Therefore, they have to be from the same layer (inner and outer) and if so, the distance is calculated. If furthermore the distance criterion, defined by the y parameter, is fulfilled, the node is saved into a vector. After those iterations, a vector is accessible, which holds all the nodes used for the Laplacian smoothing of the current node. Now, the new position is calculated (3) and (4) based on the nodes stored in the vector as seen in following equation: Whereby, N is the number of adjacent nodes to node i in the given radius, set by the x parameter, x j is the position of the j th adjacent node, and x i is the new position for node i. Improvements made on the basic Laplacian smoother are: (1.) The additional usage of the x-parameter to use just markers in the defined radius rather than all markers in the list. (2.) The so-called border markers are set as "true" markers, not being able to be moved in this calculation, since they are already set on the border by the user. Moreover, by applying a weight to these "true" markers, they gain more influence in the calculations, thus improving the final implant result even more. Note that smoothing can also cause shrinkage of an implant. However, the border markers ensure that the implant is always connected to the bone (if placed there by the user). Evaluation-Our software has been evaluated with several clinical experts from the Department of Neurosurgery at the Medical University of Graz in Austria. All physicians know the state of the art in cranial implant planning and are familiar with commercial and non-commercial software solutions. However, our evaluation consisted of three main steps. In the first step, the so-called training phase, the developer of the software showed the physicians the planning of an implant from start to finish. In the next step, the physicians have been asked to perform the planning of an implant on their own, beginning with loading a new medical dataset. In the final step, the physicians were asked to fill out a questionnaire to rate the overall software solution. Generally, the questionnaire evaluates the software ergonomic formulated in general terms without reference to situations of use, application, environment or technology [24]. However, questions like "The software does not need a lot of training time" are seen in context of the current user and his/her experience/knowledge in cranial implant planning (in respect to other software solutions). Furthermore, the time was measured during the implant planning. As a feedback summary from the clinical partners, skull mirroring, marker setting and the smoothing was integrated into a user-friendly planning prototype. However, this is also a result of the hand in hand software development between the technical and clinical partners, were constant feedback from regular meetings had been taken into consideration and constantly been integrated into the software. For the questionnaire, the following questions had been asked (derived from ISONORM 9241/10): Interactive reconstructions of cranial 3D implants 11. Would you use the software in a daily routine?
(Assumed that the 3D printed implant would fit with just a few adjustments) Table 1 and Fig 8 presents the results of the questionnaire which were rated using a six-point Likert scale with increasing consent from one to six [25]. In addition, the photo shows the corresponding patient skull which has also been 3D printed for testing purposes (white). The planning time for cranial 3D implant could be reduced to about thirty minutes for a new medical user. However, for a user familiar with the software, the planning time could even be reduced to about fifteen minutes. This stands in strong contrast to a reported planning time of several hours for Blender, where our clinical partners shift vertex per vertex of a geometrical form into position and traditional softwares (such as Imageware, UG, and Magics RP) with a planning time around two hours. The overall planning starts with loading the STL file into our software (as stated before the transformation from CT/DICOM data to STL can be done with the MeVisLab WEMIsoSurface module or Slicer [26] in a few minutes). Typical times for an  Interactive reconstructions of cranial 3D implants

Results
The results yielded to a DSC of 88.08% and a HD of 5.41 voxel. This shows how well two implants agree when planned with our software even between users: User 1: 28581775 voxel, 115900 mm 3 User 2: 28450794 voxel, 115369 mm 3

Discussion
The constructing of cranial 3D implants is a challenging task and lacks on free software especially designed for the specific planning tasks. Commercially available software, like Mimics/ 3-matic, KLS Martin or companies that provide services for these applications, can be very complex and expensive, and may also not be available in a clinic. In this contribution, however, the semi-automatic planning of cranial 3D Implants has been demonstrated under the medical prototyping platform MeVisLab, which is free for own research purposes. The MeVisLab prototype consists of a customized data-flow network and the results showed that MeVisLab can be an alternative to complex commercial planning software. Overall, the user is guided through the workflow of the software prototype, starting with loading and mirroring the patients head, to generate an initial curvature of the cranial implant. However, because human heads are in general too asymmetric, pure mirroring is not sufficient to generate an implant and our software enables Delaunay triangulation with Laplacian smoothing to generate an aesthetic looking and well-fitting implant. Moreover, our software prototype allows the user to save the designed 3D model of the cranial implant as a STL file for 3D printing. The printed cranial implant can be used for further pre-interventional planning, like verifying the size and shape (Fig 12), or it can even be used as the real 3D implant for the patient in an following operation. In summary, the achieved highlights of this contribution are: • The successful interactive planning and reconstruction of cranial 3D implants under MeVisLab; • Enables skull mirroring to obtain an initial curvature of the implant for the defect restoration; • Offers additional smoothing and triangulation for an aesthetic looking and well-fitting outcome; • Has been evaluated with real patient Computed Tomography (CT) data from the clinical routine; • Allows 3D implant exporting as Computer-Aided Design (CAD) file format for 3D printing and in-depth pre-surgical assessment; • Providing the source code and clinical datasets to the research community for own usage.
There are several areas of future work, including an evaluation with a greater patient collective as we collect more clinical datasets, and intra-and inter-rater reliability ratings of the planned implants. Furthermore, a comprehensive comparison and evaluation study with  commercial available software products. Therefore, collecting datasets and real manufactured implants from the clinical routine, which will be 3D scanned to compare them with the planned implants from our software. Moreover, a direct comparison with an open-source software developed by colleagues at the Jiao Tong University in China [29]. Finally, testing the software in areas where 3D printing technology plays also an important role, like oral implantology, pelvis and cervical vertebrae implants [30] and integration into a medical AR navigation system [31].