RTK  2.0.0
Reconstruction Toolkit
rtkCyclicDeformationImageFilter.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 rtkCyclicDeformationImageFilter_h
20 #define rtkCyclicDeformationImageFilter_h
21 
22 #include <itkImageToImageFilter.h>
23 
24 #include "rtkConfiguration.h"
25 #include "rtkMacro.h"
26 
27 namespace rtk
28 {
29 
49 template <class TInputImage, class TOutputImage>
51  public itk::ImageToImageFilter<TInputImage, TOutputImage >
52 {
53 public:
56  typedef TInputImage InputImageType;
57  typedef TOutputImage OutputImageType;
61  typedef typename OutputImageType::RegionType OutputImageRegionType;
62 
64  itkNewMacro(Self);
65 
68 
71  itkGetMacro(SignalFilename, std::string);
72  virtual void SetSignalFilename (const std::string _arg);
73  virtual void SetSignalVector (std::vector<double> _arg);
75 
78  itkGetMacro(Frame, unsigned int);
79  itkSetMacro(Frame, unsigned int);
81 
82 protected:
84  virtual ~CyclicDeformationImageFilter() ITK_OVERRIDE {}
85 
86  void GenerateOutputInformation() ITK_OVERRIDE;
87  void GenerateInputRequestedRegion() ITK_OVERRIDE;
88  void BeforeThreadedGenerateData() ITK_OVERRIDE;
89 #if ITK_VERSION_MAJOR<5
90  void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread,
91  ThreadIdType threadId ) ITK_OVERRIDE;
92 #else
93  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
94 #endif
95 
96  // Linear interpolation position and weights
97  unsigned int m_FrameInf;
98  unsigned int m_FrameSup;
99  double m_WeightInf;
100  double m_WeightSup;
101 
102 private:
103  CyclicDeformationImageFilter(const Self&); //purposely not implemented
104  void operator=(const Self&); //purposely not implemented
105 
106  unsigned int m_Frame;
107 
108  std::string m_SignalFilename;
109  std::vector<double> m_Signal;
110 };
111 
112 } // end namespace rtk
113 
114 #ifndef ITK_MANUAL_INSTANTIATION
115 #include "rtkCyclicDeformationImageFilter.hxx"
116 #endif
117 
118 #endif
itk::SmartPointer< const Self > ConstPointer
Return 3D deformation vector field according to input 4D vector field, phase signal and frame number...
unsigned int ThreadIdType
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
#define itkSetMacro(name, type)