Applies a total variation denoising filter to an image. More...
#include <itkTotalVariationDenoisingImageFilter.h>
Public Types | |
typedef TInputImage | InputImageType |
typedef TOutputImage | OutputImageType |
typedef TotalVariationDenoisingImageFilter | Self |
typedef ImageToImageFilter < InputImageType, OutputImageType > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef InputImageType::PixelType | InputPixelType |
typedef OutputImageType::PixelType | OutputPixelType |
typedef InputImageType::RegionType | InputImageRegionType |
typedef OutputImageType::RegionType | OutputImageRegionType |
typedef InputImageType::SizeType | InputSizeType |
typedef TotalVariationSingleIterationImageFilter < TOutputImage, TOutputImage > | SingleIterationFilterType |
typedef itk::CastImageFilter < TInputImage, TOutputImage > | CastType |
Public Member Functions | |
itkStaticConstMacro (InputImageDimension, unsigned int, TInputImage::ImageDimension) | |
itkStaticConstMacro (OutputImageDimension, unsigned int, TOutputImage::ImageDimension) | |
virtual const char * | GetClassName () const |
virtual void | SetLambda (double _arg) |
virtual double | GetLambda () |
virtual void | SetNumberIterations (int _arg) |
virtual int | GetNumberIterations () |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
TotalVariationDenoisingImageFilter () | |
virtual | ~TotalVariationDenoisingImageFilter () |
void | PrintSelf (std::ostream &os, Indent indent) const |
void | GenerateData () |
Protected Attributes | |
double | m_Lambda |
int | m_NumberIterations |
Applies a total variation denoising filter to an image.
Reference: Tony F. Chan et al., The digital TV filter and nonlinear denoising
Definition at line 36 of file itkTotalVariationDenoisingImageFilter.h.
typedef itk::CastImageFilter< TInputImage, TOutputImage > itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::CastType |
Definition at line 74 of file itkTotalVariationDenoisingImageFilter.h.
typedef SmartPointer<const Self> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::ConstPointer |
Definition at line 54 of file itkTotalVariationDenoisingImageFilter.h.
typedef InputImageType::RegionType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputImageRegionType |
Definition at line 66 of file itkTotalVariationDenoisingImageFilter.h.
typedef TInputImage itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputImageType |
Convenient typedefs for simplifying declarations.
Definition at line 47 of file itkTotalVariationDenoisingImageFilter.h.
typedef InputImageType::PixelType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputPixelType |
Image typedef support.
Definition at line 60 of file itkTotalVariationDenoisingImageFilter.h.
typedef InputImageType::SizeType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputSizeType |
Definition at line 69 of file itkTotalVariationDenoisingImageFilter.h.
typedef OutputImageType::RegionType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::OutputImageRegionType |
Definition at line 67 of file itkTotalVariationDenoisingImageFilter.h.
typedef TOutputImage itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::OutputImageType |
Definition at line 48 of file itkTotalVariationDenoisingImageFilter.h.
typedef OutputImageType::PixelType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::OutputPixelType |
Definition at line 64 of file itkTotalVariationDenoisingImageFilter.h.
typedef SmartPointer<Self> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::Pointer |
Definition at line 53 of file itkTotalVariationDenoisingImageFilter.h.
typedef TotalVariationDenoisingImageFilter itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::Self |
Standard class typedefs.
Definition at line 51 of file itkTotalVariationDenoisingImageFilter.h.
typedef TotalVariationSingleIterationImageFilter<TOutputImage, TOutputImage> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::SingleIterationFilterType |
Definition at line 72 of file itkTotalVariationDenoisingImageFilter.h.
typedef ImageToImageFilter< InputImageType, OutputImageType> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::Superclass |
Definition at line 52 of file itkTotalVariationDenoisingImageFilter.h.
itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::TotalVariationDenoisingImageFilter | ( | ) | [protected] |
Definition at line 38 of file itkTotalVariationDenoisingImageFilter.txx.
{ m_Lambda = 1.0; }
virtual itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::~TotalVariationDenoisingImageFilter | ( | ) | [inline, protected, virtual] |
Definition at line 84 of file itkTotalVariationDenoisingImageFilter.h.
void itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GenerateData | ( | ) | [protected] |
Definition at line 47 of file itkTotalVariationDenoisingImageFilter.txx.
{ // first we cast the input image to match output type typename CastType::Pointer infilter = CastType::New(); infilter->SetInput(this->GetInput()); infilter->Update(); typename TOutputImage::Pointer image = infilter->GetOutput(); // a second copy of the input image is saved as reference infilter = CastType::New(); infilter->SetInput(this->GetInput()); infilter->Update(); typename TOutputImage::Pointer origImage = infilter->GetOutput(); typename SingleIterationFilterType::Pointer filter; for(int i=0; i<m_NumberIterations; i++) { filter = SingleIterationFilterType::New(); filter->SetInput( image ); filter->SetOriginalImage( origImage ); filter->SetLambda(m_Lambda); filter->SetNumberOfThreads(this->GetNumberOfThreads()); filter->UpdateLargestPossibleRegion(); image = filter->GetOutput(); std::cout << "Iteration " << i+1 << "/" << m_NumberIterations << std::endl; } typename OutputImageType::Pointer output = this->GetOutput(); output->SetSpacing(image->GetSpacing()); typename OutputImageType::RegionType largestPossibleRegion; largestPossibleRegion.SetSize( image->GetLargestPossibleRegion().GetSize() ); largestPossibleRegion.SetIndex( image->GetLargestPossibleRegion().GetIndex() ); output->SetLargestPossibleRegion( image->GetLargestPossibleRegion() ); output->SetBufferedRegion( image->GetLargestPossibleRegion() ); output->Allocate(); itk::ImageRegionIterator<OutputImageType> oit( output, output->GetLargestPossibleRegion()); oit.GoToBegin(); itk::ImageRegionConstIterator<OutputImageType> iit( image, image->GetLargestPossibleRegion()); iit.GoToBegin(); while(!oit.IsAtEnd()) { oit.Set(iit.Get()); ++iit; ++oit; } }
virtual const char* itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GetClassName | ( | ) | const [virtual] |
Run-time type information (and related methods).
virtual double itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GetLambda | ( | ) | [virtual] |
virtual int itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GetNumberIterations | ( | ) | [virtual] |
itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro | ( | OutputImageDimension | , |
unsigned | int, | ||
TOutputImage::ImageDimension | |||
) |
itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro | ( | InputImageDimension | , |
unsigned | int, | ||
TInputImage::ImageDimension | |||
) |
Extract dimension from input and output image.
static Pointer itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::New | ( | ) | [static] |
Method for creation through the object factory.
Referenced by QmitkBasicImageProcessing::StartButtonClicked().
void itk::TotalVariationDenoisingImageFilter< TInputImage, TOutput >::PrintSelf | ( | std::ostream & | os, |
Indent | indent | ||
) | const [protected] |
Standard "PrintSelf" method
Definition at line 111 of file itkTotalVariationDenoisingImageFilter.txx.
{ Superclass::PrintSelf( os, indent ); }
virtual void itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::SetLambda | ( | double | _arg ) | [virtual] |
virtual void itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::SetNumberIterations | ( | int | _arg ) | [virtual] |
double itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::m_Lambda [protected] |
Definition at line 89 of file itkTotalVariationDenoisingImageFilter.h.
int itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::m_NumberIterations [protected] |
Definition at line 91 of file itkTotalVariationDenoisingImageFilter.h.