The goal of this lab will be to segment the liver and the bones in CT scan of a pig’s liver.
Download the liver_P.vtk.zip file which contains the scanner data. Note that the data provided by the scanner is usually DICOM. Liver_P.vtk has only been converted to a vtk file in order to minimize the file size.
Visualization and Segmentation Tool: ITKSnap
Visualization and navigation
ITKSnap is a software used for the visualization and the 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 segment the liver by combining automatic and manual methods. For this purpose, 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 slices.
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 128 pixels in order to perform the segmentation much faster (at the expense of accuracy) for the first iteration.
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 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 and click on next .
You can now start the segmentation algorithm. 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 Continuous Update. The auto-update option allows to visualize the segmentation in real-time in the 3D view. The 3D view is controlled in a similar way than other views, but the left click changes the orientation of the camera.
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. We will use the Intuitive Mode tab .
The Region competition force parameter controls the volume of the segmentation, so you can decide whether the segmentation should increase the volume or instead contract. The Smoothing parameter allows to play on the level of detail or continuity of the model. The closer this parameter is to 1.0 the smoother the generated mesh will be.
Manual / automatic correction
A manual step is often necessary. The principle is to routhly correct the segmentation on each of the images manually. 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.
At any time, you can update the 3D view by clicking on update mesh.
Segmentation with the algorithm of active contours
Restart an automatic segmentation step starting from the segmented volume (it is not necessarily necessary to add new seed points ). For that select on Initialize with current segmentation and resample the image with higher resolution.
At this point the volume of the segmentation, you have obtained should be routhly 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 finised export the segmentation file. Click on the segmentation menu choose Save Segmentation Image and choose the VTK format.
Segmentation of the ribs
Repeat the previous step to get a rib and liver segmentation.