Skip to content
/ itkcvbf Public

2D/3D/4D CPU/GPU bilateral image filter based on ITK and OpenCV

License

Notifications You must be signed in to change notification settings

espdev/itkcvbf

Repository files navigation

itkcvbf

2D/3D/4D CPU/GPU bilateral filter based on ITK and OpenCV

Limitations

The filter only supports grayscale images.

Usage

#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>

#include "itkOpenCVBasedBilateralImageFilter.h"

const unsigned int Dimension = 3U;
using PixelType = signed short;
using ImageType = itk::Image<PixelType, Dimension>;

auto reader = itk::ImageFileReader<ImageType>::New();
reader->SetFileName("your_image_3d.nrrd");

auto bilateral = itk::OpenCVBasedBilateralImageFilter<ImageType>::New();
bilateral->SetRangeSigma(15);
bilateral->SetDomainSigma(5);
bilateral->SetInput(reader->GetOutput());

auto writer = itk::ImageFileWriter<ImageType>::New();
writer->SetFileName("your_image_3d_bf.nrrd");
writer->SetInput(bilateral->GetOutput());

try {
  writer->Update();
}
catch (itk::ExceptionObject & err) {
  std::cerr << err << std::endl;
  throw;
}

Examples

Brain CT axial slice Result with rs=30, ds=4 Second pass with rs=8, ds=2 (removing artifacts)

About

2D/3D/4D CPU/GPU bilateral image filter based on ITK and OpenCV

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published