RTK  1.4.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 #ifdef RTK_USE_CUDA
26  #include <itkCudaImage.h>
27 #endif
28 
29 #include "rtkMacro.h"
30 
31 namespace rtk
32 {
33 
53 template <class TInputImage, class TOutputImage>
55  public itk::ImageToImageFilter<TInputImage, TOutputImage >
56 {
57 public:
60  typedef TInputImage InputImageType;
61  typedef TOutputImage OutputImageType;
65  typedef typename OutputImageType::RegionType OutputImageRegionType;
66 
68  itkNewMacro(Self);
69 
72 
75  itkGetMacro(SignalFilename, std::string);
76  virtual void SetSignalFilename (const std::string _arg);
77  virtual void SetSignalVector (std::vector<double> _arg);
79 
82  itkGetMacro(Frame, unsigned int);
83  itkSetMacro(Frame, unsigned int);
85 
86 protected:
88  virtual ~CyclicDeformationImageFilter() ITK_OVERRIDE {}
89 
90  void GenerateOutputInformation() ITK_OVERRIDE;
91  void GenerateInputRequestedRegion() ITK_OVERRIDE;
92  void BeforeThreadedGenerateData() ITK_OVERRIDE;
93 #if ITK_VERSION_MAJOR<5
94  void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread,
95  ThreadIdType threadId ) ITK_OVERRIDE;
96 #else
97  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
98 #endif
99 
100  // Linear interpolation position and weights
101  unsigned int m_FrameInf;
102  unsigned int m_FrameSup;
103  double m_WeightInf;
104  double m_WeightSup;
105 
106 private:
107  CyclicDeformationImageFilter(const Self&); //purposely not implemented
108  void operator=(const Self&); //purposely not implemented
109 
110  unsigned int m_Frame;
111 
112  std::string m_SignalFilename;
113  std::vector<double> m_Signal;
114 };
115 
116 } // end namespace rtk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
119 #include "rtkCyclicDeformationImageFilter.hxx"
120 #endif
121 
122 #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)