void SEGgradientInPsi(const VectorMap& psi, const deformableImage& I0, const Vector &ps, VectorMap &b, vector<_real> &resol)
{
  Vector I ;
  psi.multilinInterp(I0.img(), I) ;
  psi.multilinInterpGradient(I0.img(), b) ;
  b *= I ;
  b*= ps ;
}
_real SEGenergy(const VectorMap& psi, const deformableImage& I0, const Vector &ps)
{
  Vector I ;

  psi.multilinInterp(I0.img(), I) ;
  I *= I ;
  I *= ps ;
  return I.sum() ;
}