The goal of this lab will be to generate a finite element mesh from a CT scan of a pig’s liver.
Download the liver_P.vtk file which contains the scanner data. Note that the data provided by the scanner is usually DICOM. Liver_P.vtk has simply been converted to a file to minimize the file size.
Visualization and Segmentation Tool: ITKSnap
Visualization and navigation
ITKSnap is a software used for visualization and segmentation of 3D medical images. It provides a semi-automatic segmentation solution using active contouring methods, and also allows for manual correction of the contours of the organs.
ITKSnap by typing using the
itksnap command in a terminal and open (File-> Open GrayScale Image) the scanner data
In sagittal and coronal axial views, you can use the wheel or sliders on the edges of the windows to move the section plane forward or backward. Left-click to move the selection cursor (blue) and right-click to zoom in or out, and finally click to move the view window.
Locate and visualize the liver in the image sequences.
We will now segment the liver by combining automatic and manual methods. To do this, click on the snake tool (from the name of the algorithm). The red rectangle represents the bounding box of the workspace. Resize the bounding box so that it fully contains the liver in all images.
When done, check Resample ROI , and click 3D Segment. For each coordinate (X, Y, Z) you are asked to select the sampling of the image on which the segmentation algorithm will work. For each coordinate choose 1:4, which means that each pixel will be averaged by its 4 neighbors, which will allow segmentation much faster (at the expense of accuracy). Choose Cubic interpolation and click OK.
In the left screen, choose Intensity regions and click Preprocess Image. In the screen that appears, the lower and upper threshold are used to select the minimum and maximum contrast that will be considered. The Smoothness value smooths the image. The segmentation algorithm will only work on the white areas, the areas displayed in blue will not be considered. This step is the most important and the most delicate. Find the optimal settings so that it stays mostly liver in the pictures. Validate, then click on next in the menu on the left.
In the next step, you need to add seed points that will initialize the algorithm. Move the slider to be located in the liver volume, then click Add bubble to add an initialization point. Before adding a sphere, you can set the radius with the raduis tab , and you can delete these points by clicking Remove Bubble. Place some initialization points (be careful to check that these points do not intersect the blue areas) and click on next .
You can now start the segmentation algorithm. To do this, click on the play button in the center of the screen. The segmented areas are now visible in red in the images. In the 3D visualization tab , you can view the model by clicking on update mesh. The auto-update option allows real-time segmentation to be visualized in the 3D view. The 3D view is controlled in a similar way to other views, but the left click changes the orientation of the camera.
Manual / automatic correction
Automatic segmentation does not provide a perfect mesh. A manual step is often necessary. The principle is to manually correct the segmentation on each of the images. Tools are provided to facilitate this tedious task.
Select the manual segmentation tool (brush) . Select the type of brush you want (square, round or adaptive) in the shape menu and adjust the size of the instrument. 3D brush allows you to apply changes to multiple images in 3D, and Isotropic applies the changes following the gradients of the image. Check both options.
In the Segmentation Options section, you can choose to add or remove volume to the 3D model by selecting the Active drawing label , that is Label 1 to add volume to the liver and Clear label to remove. The deletion of the label can also be done with the right click of the mouse.
Correct “grossly” segmentation manually. At any time, you can update the 3D view by clicking on update mesh. Once finished, restart the automatic segmentation starting from the segmented volume (it is not necessarily necessary to add new seed points ). Adjust the parameters so that the segmentation keeps a low expansion rate, but produces a rather smooth mesh. If necessary, repeat the operation and alternate between automatic segmentation and manual correction.
Segmentation with the algorithm of active contours
Restart an automatic segmentation step. At any time you can stop the algorithm by clicking stop. You can then adjust the parameters of the algorithm by clicking on Set Parameters. There are several tabs for set the same parameters. We will stay in the Intuitive Mode tab .
The Balloon force parameter controls the volume of the segmentation, so you can decide whether the segmentation should gain volume or contract. The Curvature parameter will allow to play on the level of detail or continuity of the model. The closer this parameter is to spherical, the more smooth the generated mesh will be.
At this point the volume of the segmentation, you have obtained must be consistent. Set these parameters so that the algorithm no longer adds volume ( static ) and to obtain a relatively smooth mesh. During the segmentation do not forget to check auto-update to visualize the result during the segmentation. Once the segmentation acceptable click on finish then finish and export the segmentation. In the segmentation menu choose save as image and choose the VTK format.
Segmentation of the ribs
Repeat the previous step to get a rib and liver segmentation.