ImportandpositioningofCADimplant:...

13
76 Chapter 8 Import and positioning of CAD implant: proximal femur The purpose of the +CAD module is to import a CAD model, position it interactively within your image and generate a ScanIP mask of the combined data. This tutorial will illustrate how to incorporate an implant in the proximal femur data used in Chapter 6 “Basic segmentation from CT: proximal femur”, and how to mesh the combined model. To replicate joint replacement for total hip replacement surgery, the head of the femur is removed and replaced by a titanium implant. The implant is an STL model generated in CAD software. The idea is to incorporate this implant into the proximal femur (with removed head) and mesh the result. 8.1 What you will learn CAD Data Integration l Importing STL files l Positioning objects l Combining image and CAD data Meshing l FE mesh generation l Mesh quality adjustment Image Processing l Boolean operations l FloodFill l 3D editing tools 8.2 The data The ScanIP project file for this tutorial is ProximalFemur.sip which you created in the previous tutorial (Chapter Basic segmentation from CT: proximal femur “Basic segmentation from CT: proximal femur”) and the STL file ProximalFemur_Implant.stl. Both files can be found in the ProximalFemur_Implant folder in C:\Program Files\Simpleware\Data\.

Transcript of ImportandpositioningofCADimplant:...

Page 1: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

76

Chapter

8Import and positioning of CAD implant:proximal femurThe purpose of the +CAD module is to import a CAD model, position it interactively within yourimage and generate a ScanIP mask of the combined data.

This tutorial will illustrate how to incorporate an implant in the proximal femur data used in Chapter 6“Basic segmentation from CT: proximal femur”, and how to mesh the combined model. To replicate jointreplacement for total hip replacement surgery, the head of the femur is removed and replaced by a titaniumimplant. The implant is an STL model generated in CAD software. The idea is to incorporate thisimplant into the proximal femur (with removed head) and mesh the result.

8.1 What you will learn

CAD Data Integration

l Importing STL files

l Positioning objects

l Combining image andCAD data

Meshing

l FE mesh generation

l Mesh qualityadjustment

Image Processing

l Boolean operations

l FloodFill

l 3D editing tools

8.2 The dataThe ScanIP project file for this tutorial is ProximalFemur.sip which you created in theprevious tutorial (Chapter Basic segmentation from CT: proximal femur “Basic segmentation from CT:proximal femur”) and the STL file ProximalFemur_Implant.stl. Both files can be found inthe ProximalFemur_Implant folder in C:\Program Files\Simpleware\Data\.

Page 2: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

77

8.3 CAD data integration in +CAD

8.3.1 Importing the data in the +CAD module

To import a .sip file created in ScanIP:

1. Start +CAD.

2. Open File"Open ProximalFemur.sip.

3. If the Dataset browser is not visible, click Home"Toolboxes"Dataset browserto activate it.

The Dataset browser is composed of three items: Background Volume (in this caseProximalFemur), Masks and CAD Models which you can expand to see your datasets.TheMasks component contains the same list of masks as were visible in ScanIP (in this casethe masks are: Femur and Femur_ Cavity ) and the CAD Models component (emptyinitially) representing the CAD and/or STL models imported in +CAD.

4. If the Active tool pane is not visible, activate it by clickingHome"Toolboxes"Active

tool .

Your screen should now look similar to Figure 8.1. +CAD is a purely 3D environment. If you likehaving different views and layouts, use the Layout buttons or right click on the View menutoolbar at the top of each view.

Figure 8.1: Screen with Dataset browser and Active tool pane

Page 3: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

78

8.3.2 Importing and positioning the implant

To import the implant:

1. Click Home"Import"STL File .

2. In the Import STL File dialog (Figure 8.2):a. Click Browse… and Open the implant file ProximalFemur_Implant.stl.

b. Click the Refresh button to preview the implant and to display the number ofpoints and polygons in the STL model.

c. You can move the implant with the mouse and reset to the original view by clicking the

Reset button .

d. To import the implant click OK .

Figure 8.2: Import STL File dialog

After importing the implant your screen should look like Figure 8.3. The CAD file is positioned at the0, 0, 0 of the DICOM data. This may be different to the project origin as this also takes in to accountthe offset of the patient position provided in the DICOM tags.

Page 4: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

79

Figure 8.3: Screen after importing the implant from CAD

Now you can position the implant.

To position the implant:

1. Change the model opacity to make positioning easier.

a. Right click on Femur_Cavity in the Dataset browser and click Toggle vis-ibility . This will make it invisible.

b. Right click on Femur in the Dataset browser and change the opacity to 0.3. Thiswill make it transparent.

2. Click Manipulation" Interactive"Rotate + Translate to activate the Inter-active CAD manipulation widget, and position the implant inside the femur. Make surethe implant is selected, and then use the axis arrows to translate and the ribbons to rotate aboutthe axes or the screen. To help with positioning the implant it is helpful to move the camera sothat it is oriented along one of the three axes and then carry out the translation. Press x, y or zto orient the camera along the associated axis. Repeating the process with the camera orientedalong each of the three axes to quickly and easily translate the implant to the desired position.

Page 5: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

80

Tip

You can rotate, pan and zoom the model using mouse and keyboard:

Mouse / Keyboard  Action

Left button (hold) + move Rotate camera around object

Wheel scroll up / down

OR Right button (hold) +move up / down

Zoom in / out

[Shift] + left button (hold) +move

ORMiddle button (hold) +move

Pan camera: move the point in space at whichthe camera is aiming

[Ctrl] + left button (hold) +move

Rotate camera around an axis perpendicularwith the viewing plane

3. The final position should look similar to Figure 8.4.

Figure 8.4: Implant in its final position inside the femur

4. Alternatively, open the CAD manipulation pane (Manipulation"Static"CAD manip-

ulation ). In the Absolute transform type-in select Use global axes from thedrop-down list, enter the PositionPosition and Orientation information as shown in Figure8.5. Click Apply to position the implant.

Page 6: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

81

Figure 8.5: Settings for positioning the CAD implant automatically

8.3.3 Exporting your model to ScanIP

Before you can export your model to ScanIP, you will need to create a mask of the CAD model. Firstthe CAD object needs to be converted to an image-based mask. Therefore we need to ensure that thecurrent voxel grid size is sufficient to preserve the features of the CAD.

To identify the optimum sampling rate for CAD to mask conversion:

1. Open the Resampling pane (Home"Tools"Resampling ).

2. Click on Preview… to open the Resampling – CAD Model Voxelisation Previewdialog. In the dialog (Figure 8.6):

a. Leave the New Spacing [mm] as 0.7.b. Select Accurate (for manifold objects) in the Enhanced voxelisation section,and tick Smooth artefacts in Options .

c. Click Update Preview or use the Refresh button to update the view accordingto your settings.

d. As the current resolution preserves the CAD object (Figure 8.6) we can accept the exist-ing image resolution. Click Close to go back to the Resampling pane.

3. Click Apply .

Page 7: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

82

Figure 8.6: Resampling preview

To convert your CAD model to masks (voxelisation):

1. Click Home"Tools"CAD to Mask to open the CAD to Mask pane.2. In the CAD to Mask pane leave the default settings as determined in the previous section,i.e.:

a. Select Accurate (for manifold objects) in the Conversion type section.b. Tick Smooth artefacts in the Options section.c. Apply the conversion.

Your data is now ready to be exported to ScanIP for meshing and further operations.

To export to ScanIP:

1. Open the Export to ScanIP dialog File"Export"ScanIP Export. In the dialog (Fig-ure 8.7):

a. Tick all the Masks you want to export to ScanIP.b. Click OK .

2. Rename the file to ProximalFemur_WithImplant.sip and Save it to disk.

Page 8: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

83

Figure 8.7: Export mask selection

8.4 Image processing in ScanIP

8.4.1 Importing and preparing the image data

To import the file created in +CAD and put the masks in the correct order:

1. Start ScanIP.

2. Open File"Open ProximalFemur_WithImplant.sip.3. In the Dataset browser , drag the masks to change the order matching Figure 8.8.

Figure 8.8: Get the masks into the right order

Note

The priority (order in the Dataset browser ) of the masks is very important. The mask at thetop of the list (in this case the ProximalFemur_Implant from CAD) will override all theother masks in case of overlaps. Also when it comes to meshing, the mask with the highestpriority will be smoothed first, followed by the others.

8.4.2 Removing the head of the femur

Before we can mesh the femur and implant we first need to remove the head of the femur using the3D editing tools available in ScanIP. Firstly to simplify the model we will also combine the Femurmask with the Femur_Cavity mask.

Page 9: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

84

To combine the femur and femur_cavity masks:

1. Union the Femur and the Femur_Cavity masks: Right click on Femur and selectBoolean operations"Union with"Femur_Cavity"On all slices .

2. Right click on Femur_Cavity and Toggle visibility to make it invisible.

To remove the head of the femur:

1. In the 3D view tool bar , click on the Fast preview button to create the 3D visu-alisation.

2. Maximise the 3D view by clicking on the Expand view button .

3. In the Dataset browser , make sure the Femur is the active mask.

4. Click Image processing"Segmentation"3D editing to open the 3D editingpane (Figure 8.9).

Figure 8.9: 3D editing pane

5. In the 3D editing pane select the Cuboid ROI button .

6. In the 3D view position the mouse cursor at the centre of the femur head and use a left click,hold down and drag away to create a cuboid in the approximate location as shown in Figure8.10.

Page 10: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

85

Figure 8.10: Initial position of cuboid selection

7. To finalise the position use the ROI manipulation widget (the orange circle with thick bor-der) to change the size. To rotate the cuboid, either move the mouse over the transparentsphere and left click and drag, or use the coloured ribbons to rotate about a specific axis. Totranslate, click and drag along the arrows indicating the corresponding axis. The final position ofthe cuboid should look like Figure 8.11.

Figure 8.11: Positioning the cuboid

8. In the 3D editing pane:a. Set the Operation to Delete and tick Update on the fly as shown in Figure 8.12.This will delete the Femur mask in the cuboid region, and then update the 3D view

Page 11: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

86

automatically.

Figure 8.12: Setting the operation to delete and to update on the fly

b. Click Apply . The edited model now looks like Figure 8.13

Figure 8.13: Finished model after 3D editing.

c. Click on the Clear button to remove the created region of interest.

Page 12: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

87

8.5 Meshing in ScanIP (with +FE module)

8.5.1 Creating a model for meshing

To create a model:

1. In the Dataset browser right click on Models and click on Create a new FE Model.2. Drag the masks you want to export intoModel 1 (FE, active) as shown in Figure 8.14.

Figure 8.14: Model for FE mesh and export

To configure the model:

1. Right click onModel 1 (FE, active) in the Dataset browser and go toModel con-figuration...

2. In theModel configuration dialog:a. Leave FE as yourModel type.b. Select Abaqus volume (solid/shells) as your Export type .c. In the Volume meshing tab, move the Compound Coarseness slider to -30.d. Leave the default settings for all the other options.

e. Click Close to leave the dialog.

8.5.2 Generating the mesh

To mesh your model:

1. To mesh your model, go to the FE model tab and click on Full model as shown in Figure8.15.

Figure 8.15: Full model command in the FE model tab

Choose Ansys Workbench volume (solid/shells) instead to export a file that is compatible with Workbench.

Phillip
Highlight
Phillip
Highlight
Page 13: ImportandpositioningofCADimplant: proximalfemurweb.aeromech.usyd.edu.au/AMME5981/Course_Documents... · 77 8.3 CADdataintegrationin+CAD 8.3.1 Importingthedatainthe+CADmodule Toimporta.sipfilecreatedinScanIP:

88

2. The result should look similar to Figure 8.16. The multipart model is automatically adaptivelymeshed to a high standard whilst still maintaining the conforming interfaces between implantand bone.

Figure 8.16: Final multipart mesh: mesh with vertex line (left), clipping the mesh (middle), and showing the interior with opacity (right)

To see the mesh qualities, go to the Log workspace tab.

Try remeshing the model with different +FE Free coarseness settings to see how it affects thenumbers of elements/nodes.

Try using the Visibility options (View" 3D display ) to change how the model is displayed.To quickly change a part/mask’s visibility options point the mouse cursor at the part/mask in the 3Dview and right click to open its visibility context menu.

If you are happy with your mesh simply click Export in the FE model tab in the Generalgroup, and save your mesh.