RTK  2.0.1
Reconstruction Toolkit
rtkExtractPhaseImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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 
19 #ifndef rtkExtractPhaseImageFilter_h
20 #define rtkExtractPhaseImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 
24 namespace rtk
25 {
46 template<class TImage>
47 class ITK_EXPORT ExtractPhaseImageFilter :
48  public itk::InPlaceImageFilter<TImage>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(ExtractPhaseImageFilter);
52 
58 
60  using KernelSizeType = typename TImage::SizeType::SizeValueType;
61  using PositionsListType = std::vector<int>;
62  typedef enum {LOCAL_PHASE=0,
64  LINEAR_BETWEEN_MAXIMA} ModelType;
65 
67  itkNewMacro(Self);
68 
71 
74  itkSetMacro(MovingAverageSize, KernelSizeType)
75  itkGetMacro(MovingAverageSize, KernelSizeType)
76 
81  itkSetMacro(UnsharpMaskSize, KernelSizeType)
82  itkGetMacro(UnsharpMaskSize, KernelSizeType)
83 
86  itkGetMacro(MinimaPositions, PositionsListType)
87  itkGetMacro(MaximaPositions, PositionsListType)
88 
96  itkSetMacro(Model, ModelType)
97  itkGetMacro(Model, ModelType)
98 
99 protected:
101  ~ExtractPhaseImageFilter() override = default;
102 
103  void GenerateData() override;
104 
105 private:
106  void ComputeLinearPhaseBetweenPositions(const PositionsListType & positions);
107 
108  KernelSizeType m_MovingAverageSize;
109  KernelSizeType m_UnsharpMaskSize;
110  PositionsListType m_MinimaPositions;
111  PositionsListType m_MaximaPositions;
112  ModelType m_Model;
113 }; // end of class
114 
115 } // end of namespace rtk
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "rtkExtractPhaseImageFilter.hxx"
119 #endif
120 
121 #endif
typename TImage::SizeType::SizeValueType KernelSizeType
Extracts the phase of a 1D signal.
#define itkSetMacro(name, type)