ITK  5.4.0
Insight Toolkit
itkTimeVaryingVelocityFieldIntegrationImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 #ifndef itkTimeVaryingVelocityFieldIntegrationImageFilter_h
19 #define itkTimeVaryingVelocityFieldIntegrationImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
24 
25 namespace itk
26 {
52 template <typename TTimeVaryingVelocityField,
53  typename TDisplacementField =
54  Image<typename TTimeVaryingVelocityField::PixelType, TTimeVaryingVelocityField::ImageDimension - 1>>
56  : public ImageToImageFilter<TTimeVaryingVelocityField, TDisplacementField>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(TimeVaryingVelocityFieldIntegrationImageFilter);
60 
65 
67  itkNewMacro(Self);
68 
70  itkOverrideGetNameOfClassMacro(TimeVaryingVelocityFieldIntegrationImageFilter);
71 
75  static constexpr unsigned int InputImageDimension = TTimeVaryingVelocityField::ImageDimension;
76 
77  static constexpr unsigned int OutputImageDimension = TDisplacementField::ImageDimension;
78 
79  using TimeVaryingVelocityFieldType = TTimeVaryingVelocityField;
80  using DisplacementFieldType = TDisplacementField;
82  using VectorType = typename DisplacementFieldType::PixelType;
83  using RealType = typename VectorType::RealValueType;
84  using ScalarType = typename VectorType::ValueType;
87 
90 
93 
95  itkSetObjectMacro(VelocityFieldInterpolator, VelocityFieldInterpolatorType);
96  itkGetModifiableObjectMacro(VelocityFieldInterpolator, VelocityFieldInterpolatorType);
103  itkSetObjectMacro(DisplacementFieldInterpolator, DisplacementFieldInterpolatorType);
104  itkGetModifiableObjectMacro(DisplacementFieldInterpolator, DisplacementFieldInterpolatorType);
110  itkSetObjectMacro(InitialDiffeomorphism, DisplacementFieldType);
111  itkGetModifiableObjectMacro(InitialDiffeomorphism, DisplacementFieldType);
118  itkSetClampMacro(LowerTimeBound, RealType, 0, 1);
119 
124  itkGetConstMacro(LowerTimeBound, RealType);
125 
130  itkSetClampMacro(UpperTimeBound, RealType, 0, 1);
131 
136  itkGetConstMacro(UpperTimeBound, RealType);
137 
142  itkSetMacro(NumberOfIntegrationSteps, unsigned int);
143 
148  itkGetConstMacro(NumberOfIntegrationSteps, unsigned int);
149 
158  itkSetMacro(TimeBoundsAsRates, bool);
159  itkGetConstMacro(TimeBoundsAsRates, bool);
160  itkBooleanMacro(TimeBoundsAsRates);
163 protected:
166 
167  void
168  PrintSelf(std::ostream & os, Indent indent) const override;
169 
170  void
171  GenerateOutputInformation() override;
172 
173  void
174  BeforeThreadedGenerateData() override;
175 
176  void
177  DynamicThreadedGenerateData(const OutputRegionType &) override;
178 
179 
180  VectorType
181  IntegrateVelocityAtPoint(const PointType & initialSpatialPoint, const TimeVaryingVelocityFieldType * inputField);
182 
183  RealType m_LowerTimeBound{};
184  RealType m_UpperTimeBound{};
185 
186  DisplacementFieldPointer m_InitialDiffeomorphism{};
187 
188  unsigned int m_NumberOfIntegrationSteps{};
189 
190  unsigned int m_NumberOfTimePoints{};
191 
192  DisplacementFieldInterpolatorPointer m_DisplacementFieldInterpolator{};
193 
194  bool m_TimeBoundsAsRates{ true };
195 
196 private:
197  VelocityFieldInterpolatorPointer m_VelocityFieldInterpolator{};
198 };
199 } // namespace itk
200 
201 #ifndef ITK_MANUAL_INSTANTIATION
202 # include "itkTimeVaryingVelocityFieldIntegrationImageFilter.hxx"
203 #endif
204 
205 #endif
itk::TimeVaryingVelocityFieldIntegrationImageFilter
Integrate a time-varying velocity field using 4th order Runge-Kutta.
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:55
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::TimeVaryingVelocityFieldIntegrationImageFilter::RealType
typename VectorType::RealValueType RealType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:83
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::TimeVaryingVelocityFieldIntegrationImageFilter::OutputRegionType
typename DisplacementFieldType::RegionType OutputRegionType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:86
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::VectorInterpolateImageFunction
Base class for all vector image interpolators.
Definition: itkVectorInterpolateImageFunction.h:47
itk::TimeVaryingVelocityFieldIntegrationImageFilter::DisplacementFieldInterpolatorPointer
typename DisplacementFieldInterpolatorType::Pointer DisplacementFieldInterpolatorPointer
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:92
itk::TimeVaryingVelocityFieldIntegrationImageFilter::PointType
typename DisplacementFieldType::PointType PointType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:85
itk::TimeVaryingVelocityFieldIntegrationImageFilter::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:81
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::TimeVaryingVelocityFieldIntegrationImageFilter::ScalarType
typename VectorType::ValueType ScalarType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:84
itk::TimeVaryingVelocityFieldIntegrationImageFilter::VectorType
typename DisplacementFieldType::PixelType VectorType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:82
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::TimeVaryingVelocityFieldIntegrationImageFilter::VelocityFieldInterpolatorPointer
typename VelocityFieldInterpolatorType::Pointer VelocityFieldInterpolatorPointer
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:89
itkVectorInterpolateImageFunction.h
itkImageToImageFilter.h
itk::TimeVaryingVelocityFieldIntegrationImageFilter::TimeVaryingVelocityFieldType
TTimeVaryingVelocityField TimeVaryingVelocityFieldType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:79
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TimeVaryingVelocityFieldIntegrationImageFilter::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkTimeVaryingVelocityFieldIntegrationImageFilter.h:80