ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkFrequencyBandImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 itkFrequencyBandImageFilter_h
19 #define itkFrequencyBandImageFilter_h
20 
22 
23 namespace itk
24 {
50 template< typename TImageType,
51  typename TFrequencyIterator = FrequencyFFTLayoutImageRegionIteratorWithIndex<TImageType> >
52 class FrequencyBandImageFilter : public UnaryFrequencyDomainFilter< TImageType, TFrequencyIterator >
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(FrequencyBandImageFilter);
56 
62 
64  itkNewMacro(Self);
65 
68 
70  using ImageType = TImageType;
71  using ImagePointer = typename ImageType::Pointer;
72  using ImageConstPointer = typename ImageType::ConstPointer;
73  using IndexType = typename TImageType::IndexType;
74  using PixelType = typename TImageType::PixelType;
75 
78 
79  static constexpr unsigned int ImageDimension = TImageType::ImageDimension;
80 
82  using FrequencyIteratorType = TFrequencyIterator;
83  using FrequencyValueType = typename FrequencyIteratorType::FrequencyValueType;
84 
85 /****** Frequency Threshold Getters/Setters *****/
86 
88  itkGetConstReferenceMacro(LowFrequencyThreshold, FrequencyValueType);
89  itkSetMacro(LowFrequencyThreshold, FrequencyValueType);
90 
95  void SetLowFrequencyThresholdInRadians(const FrequencyValueType& freqLowInRadians);
96 
98  itkGetConstReferenceMacro(HighFrequencyThreshold, FrequencyValueType);
99  itkSetMacro(HighFrequencyThreshold, FrequencyValueType);
100  void SetHighFrequencyThresholdInRadians(const FrequencyValueType& freqHighInRadians);
102 
110  void SetFrequencyThresholds( const FrequencyValueType& freqLow,
111  const FrequencyValueType& freqHigh);
112 
120  void SetFrequencyThresholdsInRadians( const FrequencyValueType& freqLowInRadians,
121  const FrequencyValueType& freqHighInRadians);
122 
125  itkSetMacro( PassLowFrequencyThreshold, bool );
126  itkGetConstReferenceMacro(PassLowFrequencyThreshold, bool);
127  itkBooleanMacro( PassLowFrequencyThreshold );
129 
132  itkSetMacro( PassHighFrequencyThreshold, bool );
133  itkGetConstReferenceMacro(PassHighFrequencyThreshold, bool);
134  itkBooleanMacro( PassHighFrequencyThreshold );
136 
138  itkSetMacro( PassBand, bool );
139  itkGetConstReferenceMacro(PassBand, bool);
140  itkBooleanMacro( PassBand );
142 
152  void SetPassBand(const bool pass_low_threshold, const bool pass_high_threshold);
153 
163  void SetStopBand(const bool pass_low_threshold, const bool pass_high_threshold);
164 
166  itkSetMacro( RadialBand, bool );
167  itkGetConstReferenceMacro(RadialBand, bool);
168  itkBooleanMacro( RadialBand );
170 
173  itkSetMacro( PassNegativeLowFrequencyThreshold, bool );
174  itkGetConstReferenceMacro(PassNegativeLowFrequencyThreshold, bool);
175  itkBooleanMacro( PassNegativeLowFrequencyThreshold );
177 
180  itkSetMacro( PassNegativeHighFrequencyThreshold, bool );
181  itkGetConstReferenceMacro(PassNegativeHighFrequencyThreshold, bool);
182  itkBooleanMacro( PassNegativeHighFrequencyThreshold );
184 
185 
186 protected:
188  void PrintSelf(std::ostream & os, Indent indent) const override;
189 
190  /* Checks the logic of FrequencyThresholds. */
191  void VerifyPreconditions() ITKv5_CONST override;
192 
193  /* This is the box functor, which implements the filter's behavior. */
194  void BandPass( FrequencyIteratorType& frequency );
195 
196 private:
198 
201 
202  bool m_PassBand{true};
205  bool m_RadialBand{true};
208 };
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkFrequencyBandImageFilter.hxx"
213 #endif
214 
215 #endif
typename ImageType::Pointer ImagePointer
Performs a frequency band filtering on a frequency domain image.
Light weight base class for most itk classes.
void SetLowFrequencyThresholdInRadians(const FrequencyValueType &freqLowInRadians)
typename TImageType::PixelType PixelType
void SetStopBand(const bool pass_low_threshold, const bool pass_high_threshold)
void BandPass(FrequencyIteratorType &frequency)
void SetFrequencyThresholds(const FrequencyValueType &freqLow, const FrequencyValueType &freqHigh)
void PrintSelf(std::ostream &os, Indent indent) const override
void VerifyPreconditions() ITKv5_CONST override
Verifies that the process object has been configured correctly, that all required inputs are set...
typename FrequencyIteratorType::FrequencyValueType FrequencyValueType
virtual void SetPassBand(bool _arg)
void SetFrequencyThresholdsInRadians(const FrequencyValueType &freqLowInRadians, const FrequencyValueType &freqHighInRadians)
std::function< void(const ImageRegionType &) > m_DynamicThreadedGenerateDataFunction
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Performs a unary operation on a frequency domain image.
static constexpr unsigned int ImageDimension
void SetHighFrequencyThresholdInRadians(const FrequencyValueType &freqHighInRadians)
typename ImageType::ConstPointer ImageConstPointer
typename TImageType::IndexType IndexType
typename TImageType::RegionType ImageRegionType