Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage > Class Template Reference

Applies a total variation denoising filter to an image. More...

#include <itkTotalVariationDenoisingImageFilter.h>

List of all members.

Public Types

typedef TInputImage InputImageType
typedef TOutputImage OutputImageType
typedef
TotalVariationDenoisingImageFilter 
Self
typedef ImageToImageFilter
< InputImageType,
OutputImageType
Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const SelfConstPointer
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

Detailed Description

template<class TInputImage, class TOutputImage>
class itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >

Applies a total variation denoising filter to an image.

Reference: Tony F. Chan et al., The digital TV filter and nonlinear denoising

See also:
Image
Neighborhood
NeighborhoodOperator
NeighborhoodIterator

Definition at line 36 of file itkTotalVariationDenoisingImageFilter.h.


Member Typedef Documentation

template<class TInputImage , class TOutputImage >
typedef itk::CastImageFilter< TInputImage, TOutputImage > itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::CastType

Definition at line 74 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef SmartPointer<const Self> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::ConstPointer

Definition at line 54 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef InputImageType::RegionType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputImageRegionType

Definition at line 66 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef TInputImage itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputImageType

Convenient typedefs for simplifying declarations.

Definition at line 47 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef InputImageType::PixelType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputPixelType

Image typedef support.

Definition at line 60 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef InputImageType::SizeType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::InputSizeType

Definition at line 69 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef OutputImageType::RegionType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::OutputImageRegionType

Definition at line 67 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef TOutputImage itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::OutputImageType

Definition at line 48 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef OutputImageType::PixelType itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::OutputPixelType

Definition at line 64 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef SmartPointer<Self> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::Pointer

Definition at line 53 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef TotalVariationDenoisingImageFilter itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::Self

Standard class typedefs.

Definition at line 51 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef TotalVariationSingleIterationImageFilter<TOutputImage, TOutputImage> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::SingleIterationFilterType

Definition at line 72 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
typedef ImageToImageFilter< InputImageType, OutputImageType> itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::Superclass

Definition at line 52 of file itkTotalVariationDenoisingImageFilter.h.


Constructor & Destructor Documentation

template<class TInputImage , class TOutputImage >
itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::TotalVariationDenoisingImageFilter (  ) [protected]

Definition at line 38 of file itkTotalVariationDenoisingImageFilter.txx.

  {
    m_Lambda = 1.0;
  }
template<class TInputImage , class TOutputImage >
virtual itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::~TotalVariationDenoisingImageFilter (  ) [inline, protected, virtual]

Member Function Documentation

template<class TInputImage , class TOutputImage >
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;
    }
  }
template<class TInputImage , class TOutputImage >
virtual const char* itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GetClassName (  ) const [virtual]

Run-time type information (and related methods).

template<class TInputImage , class TOutputImage >
virtual double itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GetLambda (  ) [virtual]
template<class TInputImage , class TOutputImage >
virtual int itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::GetNumberIterations (  ) [virtual]
template<class TInputImage , class TOutputImage >
itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( OutputImageDimension  ,
unsigned  int,
TOutputImage::ImageDimension   
)
template<class TInputImage , class TOutputImage >
itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( InputImageDimension  ,
unsigned  int,
TInputImage::ImageDimension   
)

Extract dimension from input and output image.

template<class TInputImage , class TOutputImage >
static Pointer itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::New (  ) [static]

Method for creation through the object factory.

Referenced by QmitkBasicImageProcessing::StartButtonClicked().

template<class TInputImage , class TOutput >
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 );
  }
template<class TInputImage , class TOutputImage >
virtual void itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::SetLambda ( double  _arg ) [virtual]
template<class TInputImage , class TOutputImage >
virtual void itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::SetNumberIterations ( int  _arg ) [virtual]

Member Data Documentation

template<class TInputImage , class TOutputImage >
double itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::m_Lambda [protected]

Definition at line 89 of file itkTotalVariationDenoisingImageFilter.h.

template<class TInputImage , class TOutputImage >
int itk::TotalVariationDenoisingImageFilter< TInputImage, TOutputImage >::m_NumberIterations [protected]

Definition at line 91 of file itkTotalVariationDenoisingImageFilter.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines