itk basic filters kitware inc.. itk basic filters pixel-wise arithmetic, casting, thresholding...

27
ITK Basic Filters Kitware Inc.

Upload: randall-shaw

Post on 18-Jan-2018

237 views

Category:

Documents


0 download

DESCRIPTION

Pixel-wise Intensity Filters

TRANSCRIPT

Page 1: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

ITKBasic Filters

Kitware Inc.

Page 2: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

ITK Basic Filters

Pixel-wise

Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction

Gaussian, Anisotropic diffusion Derivatives

Page 3: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Pixel-wiseIntensity Filters

Page 4: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Thresholding

InsideValue

OutsideValue

LowerThreshold

UpperThreshold

Output Value

Input Value

Page 5: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Thresholdingtypedef itk::Image< unsigned char , 2 > ImageType;typedef itk::BinaryThresholdImageFilter< ImageType > FilterType;

FilterType::Pointer filter = FilterType::New();

filter->SetLowerThreshold( 50 ); filter->SetUpperThreshold( 150 );

filter->SetOutsideValue( 0 ); filter->SetInsideValue( 255 );

filter->SetInput( reader->GetOutput() ); writer->SetInput( filter->GetOutput() ); writer->Update()

Page 6: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Thresholding

OutsideValue

LowerThreshold

UpperThreshold

Output Value

Input Value

Ramp

Page 7: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Exercise 6

Page 8: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Sigmoid

OutputMaximum

OutputMinimum

Output Value

Input ValueBeta

Alpha

Page 9: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Sigmoidtypedef itk::Image< unsigned char , 2 > ImageType;typedef itk::SigmoidImageFilter< ImageType, ImageType > FilterType;

FilterType::Pointer filter = FilterType::New();

filter->SetOutputMinimum( 0 ); filter->SetOutputMaximum( 255 );

filter->SetAlpha( 40 ); // it could be negativefilter->SetBeta( 128 );

filter->SetInput( reader->GetOutput() ); writer->SetInput( filter->GetOutput() ); writer->Update()

Page 10: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Exercise 7

Page 11: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Mathematical Morphology

typedef unsigned char PixelType;

typedef itk::Image< PixelType , 2 > ImageType;

typedef itk::BinaryBallStructuringElement< PixelType , 2 > StructuringElementType;

typedef itk::BinaryDilateImageFilter<ImageType, ImageType,StructuringElementType > FilterType;

FilterType::Pointer filter = FilterType::New();

Page 12: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Mathematical Morphology

StructuringElementType element;

element.SetRadius( 1 );element.CreateStructuringElement();

filter->SetKernel( element );filter->SetDilateValue( 255 );

thresholder->SetInput( reader ->GetOtput( ) );filter->SetInput( thresholder ->GetOtput( ) );writer->SetInput( filter ->GetOtput( ) );

writer->Update();

Page 13: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Mathematical Morphology

File reader dilate writer File

File reader dilate writer Fileerode

Page 14: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Exercise 8

Page 15: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Noise Reduction

Page 16: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Gaussian Smoothingtypedef unsigned char PixelType;

typedef itk::Image< PixelType , 2 > ImageType;

typedef itk::SmoothingRecursiveGaussianImageFilter<ImageType, ImageType,

> FilterType;

FilterType::Pointer filter = FilterType::New();

filter->SetSigma( 3.0 ); // sigma is given in millimeters

filter->SetNormalizeAcrossScale( true );

Page 17: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Gaussian Smoothing

smoother->SetInput( reader->GetOtput() );writer->SetInput( smoother->GetOtput() );

writer->Update();

File reader smooth writer File

Page 18: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Exercise 9

Page 19: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Anisotropic Diffusiontypedef float PixelType;

typedef itk::Image< PixelType , 2 > ImageType;

typedef itk::GradientAnisotropicDiffusionImageFilter<ImageType, ImageType,

> FilterType;

FilterType::Pointer filter = FilterType::New();

filter->SetTimeStep( 0.05 );filter->SetNumberOfIterations( 10 );filter->SetConductanceParameter( 3.0 );

Page 20: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Anisotropic Diffusion

• GradientAnisotropicDiffusionImageFilter

• CurvatureAnisotropicDiffusionImageFilter

• CurvatureFlowImageFilter

Page 21: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Exercise 10

Page 22: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Gradients / Derivatives

Page 23: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Gaussian Derivative

typedef unsigned char PixelType;

typedef itk::Image< PixelType , 2 > ImageType;

typedef itk::GradientRecursiveGaussianImageFilter< ImageType > FilterType;

FilterType::Pointer filter = FilterType::New();

filter->SetSigma( 3.0 ); // sigma is given in millimeters

filter->SetNormalizeAcrossScale( true );

Page 24: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Gaussian Gradient

ScalarImage

GradientGaussian

VectorImage

Convolution with Gaussian derivatives

Page 25: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Gradient Magnitudetypedef unsigned char PixelType;

typedef itk::Image< PixelType , 2 > ImageType;

typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< ImageType > FilterType;

FilterType::Pointer filter = FilterType::New();

filter->SetSigma( 3.0 ); // sigma is given in millimeters

filter->SetNormalizeAcrossScale( true );

Page 26: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Exercise 11

Page 27: ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic

Enjoy ITK !