void PatchTracking::resamplePatch() { typedef itk::ResampleImageFilter<RealImage,RealImage> ResampleFilter; ResampleFilter::Pointer resampler = ResampleFilter::New(); resampler->SetInput(_images[1]); if (_transform.IsNotNull()) { resampler->SetTransform(dynamic_cast<ResampleFilter::TransformType*>(_transform.GetPointer())); } resampler->SetReferenceImage(_patches[0]); resampler->UseReferenceImageOn(); // resampler->GraftOutput(_patches[1]); resampler->Update(); _patches[1] = resampler->GetOutput(); }