Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITK 9.3. Level Set Segmentation Shape Detection Segmentation

Similar presentations


Presentation on theme: "ITK 9.3. Level Set Segmentation Shape Detection Segmentation"— Presentation transcript:

1 ITK 9.3. Level Set Segmentation 9.3.2 Shape Detection Segmentation
9.3.3 Geodesic Active Contours Segmentation

2 9.3.2 Shape Detection Segmentation
Collaboration Diagram 9.3.2 Shape Detection Segmentation

3 1. 9.3.2 Shape Detection Segmentation 2. 1. Input image to be segmented 2. Image smoothed with an edge-preserving smoothing filter 3. gradient magnitude of the smoothed image 4. sigmoid of the gradient magnitude. This last image, the sigmoid, is used to compute the speed term for the front propagation. 3. 4.

4 9.3.2 Shape Detection Segmentation
The first stage involves smoothing using the itk::CurvatureAnisotropic DiffusionImageFilter. The smoothed image is passed as the input for the itk::Gradient MagnitudeRecursiveGaussianImageFilter and then to the itk::Sigmoid ImageFilter in order to produce the edge potential image.

5 9.3.2 Shape Detection Segmentation
A set of user-provided seeds is passed to an FastMarching ImageFilter in order to compute the distance map. A constant value is subtracted from this map in order to obtain a level set in which the zero set represents the initial contour. This level set is also passed as input to the ShapeDetection-LevelSetImageFilter. Finally, the level set at the output of the ShapeDetectionLevelSet ImageFilter is passed to an BinaryThresholdImageFilter in order to produce a binary mask representing the segmented object.

6 9.3.2 Shape Detection Segmentation
We now define the image type using a particular pixel type and a dimension. In this case the float type is used for the pixels due to the requirements of the smoothing filter. The output image, on the other hand, is declared to be binary. The type of the BinaryThreshold ImageFilter filter is instantiated below using the internal image type and the output image type.

7 9.3.2 Shape Detection Segmentation
The CurvatureAnisotropicDiffusion ImageFilter type is instantiated using the internal image type. The filter is instantiated by invoking the New() method and assigning the result to a itk::SmartPointer. The types of the Gradient MagnitudeRecursiveGaussianImageFilter and SigmoidImageFilter are instantiated using the internal image type. The corresponding filter objects are created with the method New().

8 9.3.2 Shape Detection Segmentation
The minimum and maximum values of the SigmoidImageFilter output are defined with the methods SetOutputMinimum() and SetOutputMaximum(). In our case, we want these two values to be 0.0 and 1.0 respectively in order to get a nice speed image to feed to the Fast-MarchingImageFilter. We now declare the type of the FastMarchingImageFilter that will be used to generate the initial level set in the form of a distance map.

9 9.3.2 Shape Detection Segmentation
Next we construct one filter of this class using the New() method. In the following lines we instantiate the type of the ShapeDetection LevelSetImageFilter and create an object of this type using the New() method.

10 9.3.2 Shape Detection Segmentation
The filters are now connected in a pipeline indicated in Figure 9.18 with the following code. The CurvatureAnisotropicDiffusion ImageFilter requires a couple of parameters to be defined. The following are typical values for 2D images. However they may have to be adjusted depending on the amount of noise present in the input image.

11 9.3.2 Shape Detection Segmentation
The GradientMagnitudeRecursive GaussianImageFilter performs the equivalent of a convolution with a Gaussian kernel followed by a derivative operator. The sigma of this Gaussian can be used to control the range of influence of the image edges. The SigmoidImageFilter requires two parameters that define the linear transformation to be applied to the sigmoid argument.

12 9.3.2 Shape Detection Segmentation
The FastMarchingImageFilter requires the user to provide a seed point from which the level set will be generated. The user can actually pass not only one seed point but a set of them. Note the FastMarchingImageFilter is used here only as a helper in the determination of an initial level set. We could have used the itk::Daniel ssonDistanceMapImageFilter in the same way. The seeds are stored in a container. The type of this container is defined as NodeContainer among the FastMarchingImageFilter traits.

13 9.3.2 Shape Detection Segmentation
Note that we assign the negative of the value of the user-provided distance to the unique node of the seeds passed to the FastMarching ImageFilter. In this way, the value will increment as the front is propagated, until it reaches the zero value corresponding to the contour. After this, the front will continue propagating until it fills up the entire image. The initial distance is taken from the command line arguments. The rule of thumb for the user is to select this value as the distance from the seed points at which the initial contour should be.

14 9.3.2 Shape Detection Segmentation
The list of nodes is initialized and then every node is inserted using InsertElement(). The set of seed nodes is now passed to the FastMarchingImage Filter with the method SetTrialPoints(). Since the FastMarchingImageFilter is used here only as a distance map generator, it does not require a speed image as input. Instead, the constant value 1.0 is passed using the SetSpeed Constant() method.

15 9.3.2 Shape Detection Segmentation
The FastMarchingImageFilter requires the user to specify the size of the image to be produced as output. This is done using the SetOutputSize(). Note that the size is obtained here from the output image of the smoothing filter. The size of this image is valid only after the Update() methods of this filter have been called directly or indirectly.

16 9.3.2 Shape Detection Segmentation
ShapeDetectionLevelSetImageFilter provides two parameters to control the competition between the propagation or expansion term and the curvature smoothing term. The methods SetPropagation Scaling() and SetCurvatureScaling() defines the relative weighting between the two terms.

17 9.3.2 Shape Detection Segmentation
In this example, we will set the propagation scaling to one and let the curvature scaling be an input argument. The larger the the curvature scaling parameter the smoother the resulting segmentation. However, the curvature scaling parameter should not be set too large, as it will draw the contour away from the shape boundaries.

18 9.3.2 Shape Detection Segmentation
Once activated, the level set evolution will stop if the convergence criteria or the maximum number of iterations is reached. The convergence criteria are defined in terms of the root mean squared (RMS) change in the level set function. The evolution is said to have converged if the RMS change is below a user-specified threshold.

19 9.3.2 Shape Detection Segmentation
In a real application, it is desirable to couple the evolution of the zero set to a visualization module, allowing the user to follow the evolution of the zero set. With this feedback, the user may decide when to stop the algorithm before the zero set leaks through the regions of low gradient in the contour of the anatomical structure to be segmented.

20 9.3.2 Shape Detection Segmentation

21 9.3.3 Geodesic Active Contours Segmentation
Collaboration Diagram 9.3.3 Geodesic Active Contours Segmentation

22 9.3.3 Geodesic Active Contours Segmentation
The use of the itk::GeodesicActive ContourLevelSetImageFilter is illustrated in the following example. This implementation extends the functionality of the itk::Shape DetectionLevelSetImageFilter by the addition of a third advection term which attracts the level set to the object boundaries.

23 9.3.3 Geodesic Active Contours Segmentation
The pipeline involves a first stage of smoothing using the itk::Curvature AnisotropicDiffusionImageFilter. The smoothed image is passed as the input to the itk::GradientMagnitu deRecursiveGaussianImageFilter and then to the itk::SigmoidImage Filter in order to produce the edge potential image.

24 9.3.3 Geodesic Active Contours Segmentation
A set of user-provided seeds is passed to a itk::FastMarching ImageFilter in order to compute the distance map. Finally, the level set generated by the GeodesicActiveContourLevelSet ImageFilter is passed to a itk::Binary ThresholdImageFilter in order to produce a binary mask representing the segmented object.

25 9.3.3 Geodesic Active Contours Segmentation
We now define the image type using a particular pixel type and dimension. In this case the float type is used for the pixels due to the requirements of the smoothing filter. In the following lines we instantiate the type of the GeodesicActive ContourLevelSetImageFilter and create an object of this type using the New() method.

26 9.3.3 Geodesic Active Contours Segmentation

27 9.3.3 Geodesic Active Contours Segmentation
For the GeodesicActiveContour LevelSetImageFilter, scaling parameters are used to trade off between the propagation (inflation), the curvature (smoothing) and the advection terms. These parameters are set using methods SetPropagationScaling(), SetCurvatureScaling() and SetAdvectionScaling(). In this example, we will set the curvature and advection scales to one and let the propagation scale be a command-line argument.

28 9.3.3 Geodesic Active Contours Segmentation
The filters are now connected in a pipeline indicated in Figure 9.21 using the following lines:

29 9.3.3 Geodesic Active Contours Segmentation

30 9.3.3 Geodesic Active Contours Segmentation

31 9.3.3 Geodesic Active Contours Segmentation

32 9.3.3 Geodesic Active Contours Segmentation
The invocation of the Update() method on the writer triggers the execution of the pipeline. As usual, the call is placed in a try/catch block should any errors occur or exceptions be thrown.

33 1. 9.3.3 Geodesic Active Contours Segmentation 2. 1. Input image to be segmented 2. Image smoothed with an edge-preserving smoothing filter 3. gradient magnitude of the smoothed image 4. sigmoid of the gradient magnitude. This last image, the sigmoid, is used to compute the speed term for the front propagation. 3. 4.

34 9.3.3 Geodesic Active Contours Segmentation


Download ppt "ITK 9.3. Level Set Segmentation Shape Detection Segmentation"

Similar presentations


Ads by Google