RTK  2.5.0
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  * 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 
19 #ifndef rtkUnwarpSequenceConjugateGradientOperator_h
20 #define rtkUnwarpSequenceConjugateGradientOperator_h
21 
24 
25 namespace rtk
26 {
27 
59 template <typename TImageSequence,
60  typename TDVFImageSequence =
61  itk::Image<itk::CovariantVector<typename TImageSequence::ValueType, TImageSequence::ImageDimension - 1>,
62  TImageSequence::ImageDimension>,
63  typename TImage = itk::Image<typename TImageSequence::ValueType, TImageSequence::ImageDimension - 1>,
64  typename TDVFImage =
65  itk::Image<itk::CovariantVector<typename TImageSequence::ValueType, TImageSequence::ImageDimension - 1>,
66  TImageSequence::ImageDimension - 1>>
67 class ITK_TEMPLATE_EXPORT UnwarpSequenceConjugateGradientOperator : public ConjugateGradientOperator<TImageSequence>
68 {
69 public:
70  ITK_DISALLOW_COPY_AND_MOVE(UnwarpSequenceConjugateGradientOperator);
71 
76 
78  itkNewMacro(Self);
79 
81 #ifdef itkOverrideGetNameOfClassMacro
82  itkOverrideGetNameOfClassMacro(UnwarpSequenceConjugateGradientOperator);
83 #else
85 #endif
86 
87 
89 
91  void
92  SetDisplacementField(const TDVFImageSequence * DVFs);
93 
95  typename TDVFImageSequence::Pointer
96  GetDisplacementField();
97 
99  itkSetMacro(PhaseShift, float);
100  itkGetMacro(PhaseShift, float);
102 
103  itkSetMacro(UseNearestNeighborInterpolationInWarping, bool);
104  itkGetMacro(UseNearestNeighborInterpolationInWarping, bool);
105 
107  itkSetMacro(UseCudaCyclicDeformation, bool);
108  itkGetMacro(UseCudaCyclicDeformation, bool);
110 
111 protected:
113  ~UnwarpSequenceConjugateGradientOperator() override = default;
114 
116  void
117  GenerateData() override;
118 
122 
124  bool m_UseNearestNeighborInterpolationInWarping; // Default is false, linear interpolation is used instead
125 
129  void
130  VerifyInputInformation() const override
131  {}
132 
135  void
136  GenerateInputRequestedRegion() override;
137  void
138  GenerateOutputInformation() override;
140 
142 };
143 } // namespace rtk
144 
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 # include "rtkUnwarpSequenceConjugateGradientOperator.hxx"
148 #endif
149 
150 #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.
#define itkSetMacro(name, type)