From Ohm

Thresholding with ITK

Simple thresholding example:

The threshold filter compares the input image with a threshold and replaces the image pixels which are below the threshold with an outside color (black by default).

// create threshold filter
typedef itk::ThresholdImageFilter<Image3DType> ThresholdImageFilterType;
ThresholdImageFilterType::Pointer thresholdFilter = ThresholdImageFilterType::New();

// filter settings
thresholdFilter->ThresholdBelow(200);
thresholdFilter->SetOutsideValue(0);

// connect input of filter to output of reader
thresholdFilter->SetInput(reader->GetOutput());

// pull the pipeline at its end
thresholdFilter->Update();
ThresholdBefore ThresholdAfter
ThresholdBefore3D ThresholdAfter3D

Histogram-based thresholding example:

Other intensity filters:

Retrieved from http://schorsch.efi.fh-nuernberg.de/roettger/index.php/MedicalVisualization/ThresholdingWithITK

Page last modified on November 16, 2020, at 11:39 PM