{'fraction_non_alphanumeric': 0.022959991554945634, 'fraction_numerical': 0.005489285337274359, 'mean_word_length': 5.131715210355987, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Digital Templating and Preoperative Deformity Analysis with Standard Imaging Software

Analysis of deformity and subsequent correction are the basis for many orthopaedic surgical procedures. In advanced cases of joint degeneration, arthroplasty may be the only available treatment option. Until recently, these analyses and preoperative surgical plans have been performed using standard radiographs, tracing paper, and/or plastic overlays. Numerous customized, commercially available, computer-based preoperative planning software programs have been introduced. The purposes of this study were to describe (1) the techniques used in deformity analysis and preoperative surgical planning using standard radiographs for joint arthroplasty and corrective osteotomies of the extremities, (2) the use of computed tomography (CT) scans to analyze rotational deformities in the presence and absence of joint prostheses and in planning corrective rotational osteotomies or revision joint replacement, and (3) the techniques for analyzing angular deformities of the spine. All these applications were performed with a widely available image analysis software.


Introduction
Precise preoperative planning is a vital principle of success in orthopaedic surgery. Arguably, no field in medicine is as dependent for its success on accurate planning and implementation of alignment correction and implant placement. Traditionally, preoperative planning has been performed on standard radiographs with various techniques, including the use of clear plastic templates [7][8][9]11]. Recently, digital templating was proposed as a method to electronically overlay templates from a digital library on clinical radiographs for arthroplasties [3]. The advocates of this technique cite the wide variety of available templates, the speed and precision of the technique, and elimination of hard-copy printouts of radiographs with their associated cost. The disadvantages of digital templating are the dependence on the digital library, cost of the software, and limitations in software design for each application.
The purposes of this study are to describe (1) the techniques used in deformity analysis and preoperative surgical planning using standard radiographs for joint arthroplasty and corrective osteotomies of the extremities, (2) the use of CT scans to analyze rotational deformities in the presence and absence of joint prostheses and in planning corrective rotational osteotomies or revision joint replacement, and (3) the techniques for analyzing angular deformities of the spine. For all these applications, the specific use of a widely available image analysis software is discussed.

Materials and Methods
For this study I proposed using commercially available software (Adobe 1 Photoshop 1 6.0; Adobe Systems Inc, San Jose, CA) [1] for a wide variety of orthopaedic surgical applications. However, any software program that allows calibration of measurements for lines and angles can be used. These programs are widely available for photographic editing and management. They can be used with a step-by-step technique for orthopaedic applications with lower cost and increased flexibility than commercial orthopaedic software (Tables 1-3; Figs. 1, 2).
The alignment objective in TKA is to restore a projected anteroposterior weightbearing axis of the lower extremity to pass through the center of the knee [14]. Traditionally, in the coronal plane, the goal is to perform the distal femoral cut exactly perpendicular to a line from the femoral head to the apex of the femoral notch distally. This axis is defined as the mechanical axis of the femur. The anatomic axis is defined as the line of best fit in the femoral diaphysis that passes through the center of the distal femur. The position of this axis is obtained intraoperatively by placement of an intramedullary rod in the femur starting at a point just anterior to the origin of the posterior cruciate ligament on the inferior trochlea. On the femur, the angle between the mechanical axis and the anatomic axis ( Fig. 3A-B) is determined preoperatively. This angle is measured in the software package and usually is between 4°and 7° (  Fig. 3B, black arrow). This angle is equivalent to the valgus angle set on the distal femoral cutting guide, thus achieving a distal femoral cut perpendicular to the mechanical axis of the femur. On the tibia, the goal is to cut the tibial surface exactly perpendicular to the line connecting the midpoint of the medial and lateral tibial spines and the center of the ankle. This axis is defined as the mechanical axis of the tibia. A perpendicular line is drawn to this mechanical axis line in the software package, which then can be translated proximally and distally depending on the desired degree of bone resection. By placing the distal femoral and proximal tibial cut lines on their respective bones, the profile and thickness of each cut can be predicted preoperatively (Fig. 3B) and both bone cuts will be perpendicular to their respective mechanical axes in the coronal plane. The same strategy can be applied in the sagittal plane with the measurement of the native proximal tibial slope and distal femoral flexion/extension as well as the analysis of any post-traumatic or congenital deformities involving the femur or tibia.
A second objective in planning TKA using digital templating is to select the size of the implants preoperatively. This can be performed by scanning each of the templates into a separate image file and calibrating the templates to the calibration markers placed on the radiograph ( Table 2). The preoperative plan can be performed by overlaying the template images digitally on the radiographs (Fig. 3C). This technique allows a close approximation of the ultimate implant sizes preoperatively (Fig. 3D-E).
The goal of THA is to replace the painful hip. For longterm success, many believe that the restoration of hip biomechanics may lead to improved outcomes. With appropriate preoperative planning, the hip center of rotation and the offset between the proximal femur and the acetabulum can be improved. Perhaps more importantly to patients, leg length discrepancies may be corrected. The offset is defined as the lateral displacement of the femur relative to the pelvis. The surgeon can adjust these factors based on the depth of reaming and subsequent cup placement, vertical placement of the femoral implant, type of implant used (standard versus high offset), use of offset polyethylene liners, and variations in femoral head sizes.   A. Rotate the template image, resize, and reposition it as directed in 3A-E so that its ruler portion superimposes the calibration of the preoperative radiograph; for example, the 100-mm ruler should be exactly matched to the 100-mm radiographic marker on the skin B. Once the sizing has been selected, the template image can again be rotated and repositioned (but not resized) and placed in the desired position over the bone Digital templating allows the surgeon to precisely preplan these factors to restore hip biomechanics and to minimize leg length inequality (Fig. 4).
Resurfacing THA has gained worldwide interest in recent years as a method to address younger patients with advanced hip arthritis while preserving bone for future surgical procedures. The major source of failure for this procedure is on the femoral side. Varus positioning of the femoral component in the coronal plane is one risk factor for such failure resulting from the tensile stresses applied to the lateral neck bone [16]. Notching of the bone of the femoral neck is an additional risk factor [12]. This can be the result of an excessively small femoral component diameter or a femoral preparation that is excessively in the valgus position in which the cylindrical reamer penetrates Table 3. Technique for rotational analysis of CT/MR images using Adobe 1 Photoshop 1 Steps A. Copy and paste desired cuts as separate layers into new image document (Fig. 2) B. Make all images invisible by toggling the layer visibility icon on the Layers Palette (Fig. 2, black arrow) C. Alter the opacity of the image listed higher on the layer list to 50% (Fig. 2, black arrowhead) D. The images will be superimposed at this point E. Draw lines along the axes that are to be measured (eg, femoral neck axis, transmalleolar axis, etc) as directed in general techniques (Table 1) F. Measure angles as directed in general techniques (Table 1) Fig. 1 The toolbar from the software package is shown with common tools needed for digital templating: line tool (white arrow); measure tool (small black arrows); text tool (letter T); marquee tool (black arrow); and move tool (large black arrowhead).    The indications for osteotomy of the proximal tibia include localized osteoarthritis and deformities of the lower extremity from congenital or traumatic etiologies. I have used the technique of digital templating to preplan a proximal tibial osteotomy for a posttraumatic valgus deformity (Fig. 6) and to perform a virtual correction in the coronal plane with the software. Using this technique, the size and shape of an opening wedge and closing wedge can be predicted and planned before surgery. Additionally, plate templates can be used in the same way as for joint arthroplasty to determine optimal plate length and the potential need for plate bending. The virtually osteotomized tibia can then be freely transformed and rotated until the desired correction is achieved on the image (Fig. 6B). The final mechanical axis of the extremity also can be confirmed on this image to run in the desired position. In addition to the coronal plane planning, the same strategies can be used in correcting congenital or posttraumatic deformities in the sagittal plane and in avoiding an iatrogenic sagittal deformity during correction of a pure coronal plane deformity.
Rotational malalignment of the lower extremity is an important source of disability and pain. In many cases, malalignment can be a source of patellar subluxation and dislocation. Physical examination methods such as the quadriceps angle (Q angle), J sign, femoral anteversion, and tibial torsion are examiner-dependent and do not provide quantitative information on the degree and location of deformities (ie, femoral or tibial). Thus, axial CT scans of the lower extremity provide a valuable role in measurement of these deformities. By superimposition of these images using the software package and by changing the opacity and visible layers, these relationships can be measured precisely and the optimal corrective procedures can be selected ( Table 3). The technique requires a CT scan of the pelvis, which includes the femoral heads down to the lesser trochanters, the knee from the distal femur to the level of the tibial tubercle, and the ankle to include both malleoli. To determine the femoral neck axis, various techniques have been advocated. I have used the method described by Teitge and Torga-Spak [15] (Fig. 7A) by superimposing the axial image with the femoral head center on a second axial image at the base of the neck with its center. Using the layering functions of the software, a line is drawn connecting these two points (Tables 1, 2). A second line is drawn along the posterior femoral condyles (Fig. 7B) to determine the axis or rotation of the knee. The angle between the femoral neck axis and the posterior femoral condylar line is measured and defined as the femoral anteversion. This can be performed by superimposition of the layers of the distal femur and those of the femoral neck and head (Fig. 7C). An identical technique can be used to determine external tibial torsion (Fig. 7D, white arrow) using a coronal line bisecting the tibial plateau. The angle between this line and the transmalleolar axis (Fig. 7D, black arrowhead) defines the external tibial torsion. Measurements of these values are important in the determination of congenital and posttraumatic deformities and in planning corrective osteotomies.
The analysis of rotation has important implications for evaluating patients with painful TKA. Berger et al. [2] used rotational analysis for assessment of patellar subluxation and dislocation in TKA. They compared 30 patients with patellofemoral complications after TKA with 20 patients with successful outcomes. They developed a method to measure the component rotation of the femoral and tibial components independently by superimposing the axial CT images. Femoral component rotation was measured relative to the transepicondylar axis and tibial component rotation was measured relative to the tibial tubercle (Fig. 8). They reported a combined internal rotation of 1°to 48 was Digital Planning with Imaging Software 2701 associated with lateral tracking and patellar tilt. A combined internal rotation of 3°to 88 was associated with patellar subluxation. Larger degrees of combined internal rotation (7°-178) were associated with early patellar dislocation or late patellar failure. In the case of TKA, the CT images need only include the knee down to the level of the tibial tubercle unless there is an issue regarding proximal femoral or distal tibial deformity. Using this technique, the relationship between the transepicondylar axis (Fig. 8A, black arrow) and the prosthetic posterior femoral condylar axis can be determined (Fig. 8A, white arrow). Additionally, the relationship between the tibial component ( Fig. 8B) and the tibial tubercle (Fig. 8C) can be evaluated to determine whether tibial malrotation is an underlying factor leading to patellar subluxation or dislocation (Fig. 8D). Numerous methods have been used to measure kyphotic, scoliotic, and pelvic deformities in the axial skeleton. They can include measurements of the Cobb angle [6] in scoliosis, kyphotic angles after vertebral fractures, and pelvic obliquity. The techniques described in this article can be used in making these assessments. One such example would be measurement of the kyphotic angle in guiding operative versus nonoperative treatment of burst fractures of the spine (Fig. 9). In the method described by Knight et al. [10], the angle subtended by a line overlying the inferior end plate of the vertebra above the fracture and the line overlying the inferior end plate of the fractured vertebra is measured using the techniques described here (Fig. 9C).

Discussion
The purpose of this article is to provide technical guidelines for use of a widely digital imaging software program to achieve three objectives: the use of deformity analysis and preoperative surgical planning of standard radiographs in joint arthroplasty and corrective osteotomies, the use of CT scans to analyze rotational deformities, and the analysis of angular deformities of the spine. Using these techniques, preoperative planning can be performed from anywhere and at any time as long as the images can be scanned or downloaded directly from the radiographic archive into the software program. The critical requirements of any software program used for this application include the ability to select and resize certain segments of any image, the use of multiple layers, and the ability to alter the opacity of various layers. The same approaches can be used for essentially any orthopaedic procedure requiring linear or angular correction and/or implantation of size-specific implants.
The approach suggested has some important limitations. The techniques are limited to two-dimensional imaging and each view needs to be templated independently. This limitation makes management of complex three-dimensional deformities difficult, if not impossible. Another limitation of this technique is that the accuracy and precision have not been validated. The techniques require a baseline investment of time from each operator with a variable learning curve. This can lead to insufficient interobserver and intraobserver reliability. Finally and most importantly, when used in preoperative planning, the techniques presented  here provide a tool to place the implants and perform osteotomies based on a preoperative goal. However, the ideal position of implants and extremity alignment in arthroplasty and corrective osteotomies are points of ongoing debate. Adobe 1 Photoshop 1 has been used in some medical and dental applications. Chalazonitis et al. [5] detailed a method to optimize images of radiographs obtained with a digital camera using Photoshop 1 software. They described several of the techniques discussed in this article. However, the emphasis of their study was not on preoperative planning and/or the use of the overlay template technique discussed in this article. The segmentation of MR images has been a difficult challenge often requiring either semiautomated or fully manual segmentation of images to separate bone from the surrounding soft tissues. Park et al. [13] described the use of special functions of Photoshop 1 software to perform semiautomatic segmentation of MR images. They then used these segmented images to make three-dimensional reconstructions of various anatomic structures, including the skin, bones, digestive tract, respiratory tract, urinary tract, cardiovascular system, and nervous system. They were able to fulfill their objective of substantially accelerating the segmentation process over manual segmentation. In yet another medical application of the same type of software, Carvalho et al. [4] described a digital subtraction radiography technique to evaluate chronic periapical dental lesions. The progression of these lesions was followed with serial radiographs. Traditionally, these evaluations have been qualitative. However, by using the digital subtraction technique, the authors were able to determine if the lesions were healing or expanding and also to quantify the size of the osseous lesions at each time point. The techniques for image rotation, sizing, and the use of layers are similar to those discussed in the current article.
Despite the limitations, the techniques presented here recapitulate the same techniques that have been used for decades using planning tools such as tracing paper, plastic templates, and printed radiographs. The ultimate objective of this study was to show that a universally available digital imaging software package can be used for a wide variety of orthopaedic applications, including analysis of deformities, size-specific templating of implant-related procedures, and planning of corrective surgical procedures. With progression of the digital age and gradual elimination of hard-copy radiographs, digital deformity analysis and surgical planning may soon become the standard technique.
Open Access This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.