18 #ifndef itkImageRegistrationMethodImageSource_h
19 #define itkImageRegistrationMethodImageSource_h
40 template <
typename TFixedPixelType,
typename TMovingPixelType,
unsigned int NDimension>
86 region.SetIndex(index);
105 center[0] = (double)region.GetSize()[0] / 2.0;
106 center[1] = (double)region.GetSize()[1] / 2.0;
108 const double s = (double)region.GetSize()[0] / 2.0;
121 while (!ri.IsAtEnd())
123 p[0] = ri.GetIndex()[0];
124 p[1] = ri.GetIndex()[1];
127 const double x = d[0];
128 const double y = d[1];
129 const double value = 200.0 * std::exp(-(x * x + y * y) / (s * s));
130 ri.Set(static_cast<typename MovingImageType::PixelType>(value));
135 while (!ti.IsAtEnd())
137 p[0] = ti.GetIndex()[0];
138 p[1] = ti.GetIndex()[1];
140 const double x = d[0];
141 const double y = d[1];
142 const double value = 200.0 * std::exp(-(x * x + y * y) / (s * s));
143 ti.Set(static_cast<typename FixedImageType::PixelType>(value));