docstr: Computes the Gauss-Newton energy minimization step
  
  Minimizes the linearized energy function (Newton step) defined by the
  sum of squared differences of corresponding pixels of the input images
  with respect to the displacement field.
  
  Parameters
  ----------
  forward_step : boolean
      if True, computes the Newton step in the forward direction
      (warping the moving towards the static image). If False,
      computes the backward step (warping the static image to the
      moving image)
  
  Returns
  -------
  displacement : array, shape = static_image.shape + (3,)
      if forward_step==True, the forward SSD Gauss-Newton step,
      else, the backward step
docstr_tok: ["Computes","the","Gauss-Newton","energy","minimization","step","Minimizes","the","linearized","energy","function","(","Newton","step",")","defined","by","the","sum","of","squared","differences","of","corresponding","pixels","of","the","input","images","with","respect","to","the","displacement","field",".","Parameters","--","--","--","--","--","forward_step",":","boolean","if","True",",","computes","the","Newton","step","in","the","forward","direction","(","warping","the","moving","towards","the","static","image",")",".","If","False",",","computes","the","backward","step","(","warping","the","static","image","to","the","moving","image",")","Returns","--","--","--","-","displacement",":","array",",","shape","=","static_image.shape","+","(","3",",",")","if","forward_step==True",",","the","forward","SSD","Gauss-Newton","step",",","else",",","the","backward","step"]
code: def compute_gauss_newton_step(self, forward_step=True):
      r"""Computes the Gauss-Newton energy minimization step
  
      Minimizes the linearized energy function (Newton step) defined by the
      sum of squared differences of corresponding pixels of the input images
      with respect to the displacement field.
  
      Parameters
      ----------
      forward_step : boolean
          if True, computes the Newton step in the forward direction
          (warping the moving towards the static image). If False,
          computes the backward step (warping the static image to the
          moving image)
  
      Returns
      -------
      displacement : array, shape = static_image.shape + (3,)
          if forward_step==True, the forward SSD Gauss-Newton step,
          else, the backward step
      """
      reference_shape = self.static_image.shape
  
      if forward_step:
          gradient = self.gradient_static
          delta_field = self.static_image - self.moving_image
      else:
          gradient = self.gradient_moving
          delta_field = self.moving_image - self.static_image
  
      displacement = np.zeros(
          shape=reference_shape + (self.dim,), dtype=floating
      )
  
      if self.dim == 2:
          self.energy = v_cycle_2d(
              self.levels_below,
              self.inner_iter,
              delta_field,
              None,
              gradient,
              None,
              self.smooth,
              displacement,
          )
      else:
          self.energy = v_cycle_3d(
              self.levels_below,
              self.inner_iter,
              delta_field,
              None,
              gradient,
              None,
              self.smooth,
              displacement,
          )
      return displacement
  
imports: import abc
  import numpy
  from numpy import gradient
  from scipy import ndimage
  from dipy.align import vector_fields
  from dipy.align import sumsqdiff
  from dipy.align import crosscorr
  from dipy.align import expectmax
  from dipy.align import floating
label_desc: Use image node_id 6 for calling the SSDMetric obj's underlying member method code with example usage: obj.compute_gauss_newton_step(forward_step) and returns: displacement