1 /* 2 * Medical Image Registration ToolKit (MIRTK) 3 * 4 * Copyright 2013-2015 Imperial College London 5 * Copyright 2013-2015 Andreas Schuh 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 #ifndef MIRTK_VelocityToDisplacementFieldEuler_H 21 #define MIRTK_VelocityToDisplacementFieldEuler_H 22 23 #include "mirtk/VelocityToDisplacementField.h" 24 25 26 namespace mirtk { 27 28 29 // Vector field interpolator 30 class InterpolateImageFunction; 31 32 33 /** 34 * Computes a displacement field from a stationary velocity field. 35 * 36 * This class implements an image filter which computes the exponential map 37 * of a stationary velocity field using the forward Euler integration method. 38 * The result is a diffeomorphic displacement field. 39 */ 40 template <class TVoxel> 41 class VelocityToDisplacementFieldEuler : public VelocityToDisplacementField<TVoxel> 42 { 43 mirtkImageFilterMacro(VelocityToDisplacementFieldEuler, TVoxel); 44 45 protected: 46 47 /// Image function for interpolation of velocities 48 InterpolateImageFunction *_VelocityInterpolator; 49 50 /// Initialize filter 51 virtual void Initialize(); 52 53 public: 54 55 /// Constructor 56 VelocityToDisplacementFieldEuler(); 57 58 /// Destructor 59 virtual ~VelocityToDisplacementFieldEuler(); 60 61 /// Compute output = log(input) 62 virtual void Run(); 63 64 }; 65 66 67 } // namespace mirtk 68 69 #endif // MIRTK_VelocityToDisplacementFieldEuler_H 70