ITK  6.0.0
Insight Toolkit
itkIterativeDeconvolutionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkIterativeDeconvolutionImageFilter_h
19 #define itkIterativeDeconvolutionImageFilter_h
20 
22 #include "itkProgressAccumulator.h"
23 
24 namespace itk
25 {
51 template <typename TInputImage,
52  typename TKernelImage = TInputImage,
53  typename TOutputImage = TInputImage,
54  typename TInternalPrecision = double>
55 class ITK_TEMPLATE_EXPORT IterativeDeconvolutionImageFilter
56  : public FFTConvolutionImageFilter<TInputImage, TKernelImage, TOutputImage, TInternalPrecision>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(IterativeDeconvolutionImageFilter);
60 
66 
68  using InputImageType = TInputImage;
69  using KernelImageType = TKernelImage;
70  using OutputImageType = TOutputImage;
71 
73  using typename Superclass::InternalImageType;
74  using typename Superclass::InternalImagePointerType;
75  using typename Superclass::InternalComplexType;
76  using typename Superclass::InternalComplexImageType;
77  using typename Superclass::InternalComplexImagePointerType;
78 
80  itkOverrideGetNameOfClassMacro(IterativeDeconvolutionImageFilter);
81 
83  itkSetMacro(NumberOfIterations, unsigned int);
84  itkGetMacro(NumberOfIterations, unsigned int);
88  itkGetModifiableObjectMacro(CurrentEstimate, InternalImageType);
89 
92  void
93  SetStopIteration(bool stop)
94  {
95  // Don't call Modified() to avoid triggering a new update.
96  m_StopIteration = stop;
97  }
98  itkGetConstMacro(StopIteration, bool);
102  itkGetConstMacro(Iteration, unsigned int);
103 
104 protected:
107 
109  virtual void
110  Initialize(ProgressAccumulator * progress, float progressWeight, float iterationProgressWeight);
111 
113  virtual void
114  Iteration(ProgressAccumulator * itkNotUsed(progress), float itkNotUsed(iterationProgressWeight)) = 0;
115 
117  virtual void
118  Finish(ProgressAccumulator * progress, float progressWeight);
119 
127  void
128  GenerateInputRequestedRegion() override;
129 
132  void
133  GenerateData() override;
134 
136  InternalComplexImagePointerType m_TransferFunction{};
137 
139  InternalImagePointerType m_CurrentEstimate{};
140 
141  using typename Superclass::FFTFilterType;
142  using typename Superclass::IFFTFilterType;
143 
144  void
145  PrintSelf(std::ostream & os, Indent indent) const override;
146 
147 private:
149  unsigned int m_NumberOfIterations{};
150 
152  unsigned int m_Iteration{};
153 
155  bool m_StopIteration{};
156 
158  ModifiedTimeType m_InputMTime{};
159  ModifiedTimeType m_KernelMTime{};
160 };
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 # include "itkIterativeDeconvolutionImageFilter.hxx"
165 #endif
166 
167 #endif
itk::FFTConvolutionImageFilter
Convolve a given image with an arbitrary image kernel using multiplication in the Fourier domain.
Definition: itkFFTConvolutionImageFilter.h:60
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelImageType
TKernelSource::OutputImageType KernelImageType
Definition: itkConvolutionImageFilterBase.h:75
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:105
itkFFTConvolutionImageFilter.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::IterativeDeconvolutionImageFilter::SetStopIteration
void SetStopIteration(bool stop)
Definition: itkIterativeDeconvolutionImageFilter.h:93
itk::FFTConvolutionImageFilter< TInputImage, TKernelSource::OutputImageType, TOutputImage, double >::InternalComplexImagePointerType
typename InternalComplexImageType::Pointer InternalComplexImagePointerType
Definition: itkFFTConvolutionImageFilter.h:106
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::ProgressAccumulator
Facilitates progress reporting for filters that wrap around multiple other filters.
Definition: itkProgressAccumulator.h:40
itk::IterativeDeconvolutionImageFilter
Abstract base class for filters that implement iterative deconvolution algorithms.
Definition: itkIterativeDeconvolutionImageFilter.h:55
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkProgressAccumulator.h
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::FFTConvolutionImageFilter< TInputImage, TKernelSource::OutputImageType, TOutputImage, double >::InternalImagePointerType
typename InternalImageType::Pointer InternalImagePointerType
Definition: itkFFTConvolutionImageFilter.h:103
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90