RTK  2.0.1
Reconstruction Toolkit
rtkUnwarpSequenceConjugateGradientOperator.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 rtkUnwarpSequenceConjugateGradientOperator_h
20 #define rtkUnwarpSequenceConjugateGradientOperator_h
21 
24 
25 namespace rtk
26 {
27 
59  template< typename TImageSequence,
60  typename TDVFImageSequence = itk::Image< itk::CovariantVector < typename TImageSequence::ValueType,
61  TImageSequence::ImageDimension-1 >,
62  TImageSequence::ImageDimension >,
63  typename TImage = itk::Image< typename TImageSequence::ValueType,
64  TImageSequence::ImageDimension-1 >,
65  typename TDVFImage = itk::Image<itk::CovariantVector < typename TImageSequence::ValueType,
66  TImageSequence::ImageDimension - 1 >,
67  TImageSequence::ImageDimension - 1> >
69 {
70 public:
71  ITK_DISALLOW_COPY_AND_ASSIGN(UnwarpSequenceConjugateGradientOperator);
72 
77 
79  itkNewMacro(Self)
80 
81 
82  itkTypeMacro(rtkUnwarpSequenceConjugateGradientOperator, ConjugateGradientOperator)
83 
84  using WarpSequenceFilterType = rtk::WarpSequenceImageFilter<TImageSequence, TDVFImageSequence, TImage, TDVFImage>;
85 
87  void SetDisplacementField(const TDVFImageSequence* DVFs);
88 
90  typename TDVFImageSequence::Pointer GetDisplacementField();
91 
93  itkSetMacro(PhaseShift, float)
94  itkGetMacro(PhaseShift, float)
95 
96  itkSetMacro(UseNearestNeighborInterpolationInWarping, bool)
97  itkGetMacro(UseNearestNeighborInterpolationInWarping, bool)
98 
100  itkSetMacro(UseCudaCyclicDeformation, bool)
101  itkGetMacro(UseCudaCyclicDeformation, bool)
102 
103 protected:
105  ~UnwarpSequenceConjugateGradientOperator() override = default;
106 
108  void GenerateData() override;
109 
113 
115  bool m_UseNearestNeighborInterpolationInWarping; //Default is false, linear interpolation is used instead
116 
120 #if ITK_VERSION_MAJOR<5
121  void VerifyInputInformation() override {}
122 #else
123  void VerifyInputInformation() const override {}
124 #endif
125 
126 
129  void GenerateInputRequestedRegion() override;
130  void GenerateOutputInformation() override;
132 
134 
135 };
136 } //namespace RTK
137 
138 
139 #ifndef ITK_MANUAL_INSTANTIATION
140 #include "rtkUnwarpSequenceConjugateGradientOperator.hxx"
141 #endif
142 
143 #endif
Implements the operator A used in the conjugate gradient unwarp sequence filter.
Applies an N-D + time Motion Vector Field to an N-D + time sequence of images.
TDVFImageSequence::Pointer GetDisplacementField()
#define itkSetMacro(name, type)
void SetDisplacementField(const TDVFImageSequence *DVFs)