ITK  5.4.0
Insight Toolkit
itkFrequencyBandImageFilter.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 itkFrequencyBandImageFilter_h
19 #define itkFrequencyBandImageFilter_h
20 
22 
23 namespace itk
24 {
52 template <typename TImageType, typename TFrequencyIterator = FrequencyFFTLayoutImageRegionIteratorWithIndex<TImageType>>
53 class ITK_TEMPLATE_EXPORT FrequencyBandImageFilter : public UnaryFrequencyDomainFilter<TImageType, TFrequencyIterator>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_MOVE(FrequencyBandImageFilter);
57 
63 
65  itkNewMacro(Self);
66 
68  itkOverrideGetNameOfClassMacro(FrequencyBandImageFilter);
69 
71  using ImageType = TImageType;
72  using ImagePointer = typename ImageType::Pointer;
74  using IndexType = typename TImageType::IndexType;
75  using PixelType = typename TImageType::PixelType;
76 
79 
80  static constexpr unsigned int ImageDimension = TImageType::ImageDimension;
81 
83  using FrequencyIteratorType = TFrequencyIterator;
84  using FrequencyValueType = typename FrequencyIteratorType::FrequencyValueType;
85 
86  /****** Frequency Threshold Getters/Setters *****/
87 
89  itkGetConstReferenceMacro(LowFrequencyThreshold, FrequencyValueType);
90  itkSetMacro(LowFrequencyThreshold, FrequencyValueType);
91 
96  void
97  SetLowFrequencyThresholdInRadians(const FrequencyValueType & freqLowInRadians);
98 
100  itkGetConstReferenceMacro(HighFrequencyThreshold, FrequencyValueType);
101  itkSetMacro(HighFrequencyThreshold, FrequencyValueType);
102  void
103  SetHighFrequencyThresholdInRadians(const FrequencyValueType & freqHighInRadians);
113  void
114  SetFrequencyThresholds(const FrequencyValueType & freqLow, const FrequencyValueType & freqHigh);
115 
123  void
124  SetFrequencyThresholdsInRadians(const FrequencyValueType & freqLowInRadians,
125  const FrequencyValueType & freqHighInRadians);
126 
129  itkSetMacro(PassLowFrequencyThreshold, bool);
130  itkGetConstReferenceMacro(PassLowFrequencyThreshold, bool);
131  itkBooleanMacro(PassLowFrequencyThreshold);
136  itkSetMacro(PassHighFrequencyThreshold, bool);
137  itkGetConstReferenceMacro(PassHighFrequencyThreshold, bool);
138  itkBooleanMacro(PassHighFrequencyThreshold);
142  itkSetMacro(PassBand, bool);
143  itkGetConstReferenceMacro(PassBand, bool);
144  itkBooleanMacro(PassBand);
156  void
157  SetPassBand(const bool passLowThreshold, const bool passHighThreshold);
158 
168  void
169  SetStopBand(const bool passLowThreshold, const bool passHighThreshold);
170 
173  itkSetMacro(RadialBand, bool);
174  itkGetConstReferenceMacro(RadialBand, bool);
175  itkBooleanMacro(RadialBand);
180  itkSetMacro(PassNegativeLowFrequencyThreshold, bool);
181  itkGetConstReferenceMacro(PassNegativeLowFrequencyThreshold, bool);
182  itkBooleanMacro(PassNegativeLowFrequencyThreshold);
187  itkSetMacro(PassNegativeHighFrequencyThreshold, bool);
188  itkGetConstReferenceMacro(PassNegativeHighFrequencyThreshold, bool);
189  itkBooleanMacro(PassNegativeHighFrequencyThreshold);
193 protected:
195  void
196  PrintSelf(std::ostream & os, Indent indent) const override;
197 
198  /* Checks the logic of FrequencyThresholds. */
199  void
200  VerifyPreconditions() ITKv5_CONST override;
201 
202  /* This is the box functor, which implements the filter's behavior. */
203  void
204  BandPass(FrequencyIteratorType & freqIt);
205 
206 private:
207  std::function<void(const ImageRegionType &)> m_DynamicThreadedGenerateDataFunction{};
208 
209  FrequencyValueType m_LowFrequencyThreshold{};
210  FrequencyValueType m_HighFrequencyThreshold{};
211 
212  bool m_PassBand{ true };
213  bool m_PassLowFrequencyThreshold{ true };
214  bool m_PassHighFrequencyThreshold{ true };
215  bool m_RadialBand{ true };
216  bool m_PassNegativeLowFrequencyThreshold{ true };
217  bool m_PassNegativeHighFrequencyThreshold{ true };
218 };
219 } // end namespace itk
220 
221 #ifndef ITK_MANUAL_INSTANTIATION
222 # include "itkFrequencyBandImageFilter.hxx"
223 #endif
224 
225 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::FrequencyBandImageFilter
Performs a frequency band filtering on a frequency domain image.
Definition: itkFrequencyBandImageFilter.h:53
itk::FrequencyBandImageFilter::IndexType
typename TImageType::IndexType IndexType
Definition: itkFrequencyBandImageFilter.h:74
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FrequencyBandImageFilter::FrequencyValueType
typename FrequencyIteratorType::FrequencyValueType FrequencyValueType
Definition: itkFrequencyBandImageFilter.h:84
itk::FrequencyBandImageFilter::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkFrequencyBandImageFilter.h:72
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::FrequencyBandImageFilter::ImageType
TImageType ImageType
Definition: itkFrequencyBandImageFilter.h:71
itk::FrequencyBandImageFilter::FrequencyIteratorType
TFrequencyIterator FrequencyIteratorType
Definition: itkFrequencyBandImageFilter.h:83
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::UnaryFrequencyDomainFilter
Performs a unary operation on a frequency domain image.
Definition: itkUnaryFrequencyDomainFilter.h:61
itk::FrequencyBandImageFilter::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkFrequencyBandImageFilter.h:73
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkUnaryFrequencyDomainFilter.h
itk::FrequencyBandImageFilter::ImageRegionType
typename TImageType::RegionType ImageRegionType
Definition: itkFrequencyBandImageFilter.h:78
itk::FrequencyBandImageFilter::PixelType
typename TImageType::PixelType PixelType
Definition: itkFrequencyBandImageFilter.h:75