ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkIterativeDeconvolutionImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkIterativeDeconvolutionImageFilter_h
00019 #define __itkIterativeDeconvolutionImageFilter_h
00020 
00021 #include "itkFFTConvolutionImageFilter.h"
00022 #include "itkProgressAccumulator.h"
00023 
00024 namespace itk
00025 {
00050 template< class TInputImage, class TKernelImage=TInputImage, class TOutputImage=TInputImage >
00051 class ITK_EXPORT IterativeDeconvolutionImageFilter :
00052     public FFTConvolutionImageFilter< TInputImage, TKernelImage, TOutputImage >
00053 {
00054 public:
00056   typedef IterativeDeconvolutionImageFilter                      Self;
00057   typedef FFTConvolutionImageFilter< TInputImage, TOutputImage > Superclass;
00058   typedef SmartPointer< Self >                                   Pointer;
00059   typedef SmartPointer< const Self >                             ConstPointer;
00060 
00062   typedef TInputImage                                          InputImageType;
00063   typedef TKernelImage                                         KernelImageType;
00064   typedef TOutputImage                                         OutputImageType;
00065 
00067   typedef typename Superclass::InternalImageType               InternalImageType;
00068   typedef typename Superclass::InternalImagePointerType        InternalImagePointerType;
00069   typedef typename Superclass::InternalComplexType             InternalComplexType;
00070   typedef typename Superclass::InternalComplexImageType        InternalComplexImageType;
00071   typedef typename Superclass::InternalComplexImagePointerType InternalComplexImagePointerType;
00072 
00074   itkTypeMacro(IterativeDeconvolutionImageFilter, ConvolutionImageFilterBase);
00075 
00077   itkSetMacro(NumberOfIterations, unsigned int);
00078   itkGetMacro(NumberOfIterations, unsigned int);
00080 
00082   itkGetConstObjectMacro(CurrentEstimate, InternalImageType);
00083 
00086   void SetStopIteration(bool stop)
00087   {
00088     // Don't call Modified() to avoid triggering a new update.
00089     m_StopIteration = stop;
00090   }
00091   itkGetConstMacro(StopIteration, bool);
00093 
00095   itkGetConstMacro(Iteration, unsigned int);
00096 
00097 protected:
00098   IterativeDeconvolutionImageFilter();
00099   virtual ~IterativeDeconvolutionImageFilter();
00100 
00102   virtual void Initialize(ProgressAccumulator * progress,
00103                           float progressWeight,
00104                           float iterationProgressWeight);
00105 
00107   virtual void Iteration(ProgressAccumulator * itkNotUsed(progress),
00108                          float itkNotUsed(iterationProgressWeight)) = 0;
00109 
00111   virtual void Finish(ProgressAccumulator * progress,
00112                       float progressWeight);
00113 
00121   virtual void GenerateInputRequestedRegion();
00122 
00125   virtual void GenerateData();
00126 
00128   InternalComplexImagePointerType m_TransferFunction;
00129 
00131   InternalImagePointerType m_CurrentEstimate;
00132 
00133   typedef typename Superclass::FFTFilterType  FFTFilterType;
00134   typedef typename Superclass::IFFTFilterType IFFTFilterType;
00135 
00136   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00137 
00138 private:
00139   IterativeDeconvolutionImageFilter(const Self &); // purposely not implemented
00140   void operator=(const Self &);                    // purposely not implemented
00141 
00143   unsigned int m_NumberOfIterations;
00144 
00146   unsigned int m_Iteration;
00147 
00149   bool m_StopIteration;
00150 
00152   unsigned long m_InputMTime;
00153   unsigned long m_KernelMTime;
00154 
00155 };
00156 } // end namespace itk
00157 
00158 #ifndef ITK_MANUAL_INSTANTIATION
00159 #include "itkIterativeDeconvolutionImageFilter.hxx"
00160 #endif
00161 
00162 #endif
00163