docstr: This is called by the optimizer just after setting the static image.
  
  EMMetric takes advantage of the image dynamics by computing the
  current static image mask from the originalstaticImage mask (warped
  by nearest neighbor interpolation)
  
  Parameters
  ----------
  original_static_image : array, shape (R, C) or (S, R, C)
      the original static image from which the current static image was
      generated, the current static image is the one that was provided
      via 'set_static_image(...)', which may not be the same as the
      original static image but a warped version of it (even the static
      image changes during Symmetric Normalization, not only the moving
      one).
  transformation : DiffeomorphicMap object
      the transformation that was applied to the original_static_image
      to generate the current static image
docstr_tok: ["This","is","called","by","the","optimizer","just","after","setting","the","static","image",".","EMMetric","takes","advantage","of","the","image","dynamics","by","computing","the","current","static","image","mask","from","the","originalstaticImage","mask","(","warped","by","nearest","neighbor","interpolation",")","Parameters","--","--","--","--","--","original_static_image",":","array",",","shape","(","R",",","C",")","or","(","S",",","R",",","C",")","the","original","static","image","from","which","the","current","static","image","was","generated",",","the","current","static","image","is","the","one","that","was","provided","via","'set_static_image","(","...",")","'",",","which","may","not","be","the","same","as","the","original","static","image","but","a","warped","version","of","it","(","even","the","static","image","changes","during","Symmetric","Normalization",",","not","only","the","moving","one",")",".","transformation",":","DiffeomorphicMap","object","the","transformation","that","was","applied","to","the","original_static_image","to","generate","the","current","static","image"]
code: def use_static_image_dynamics(
      self, original_static_image, transformation
  ):
      r"""This is called by the optimizer just after setting the static image.
  
      EMMetric takes advantage of the image dynamics by computing the
      current static image mask from the originalstaticImage mask (warped
      by nearest neighbor interpolation)
  
      Parameters
      ----------
      original_static_image : array, shape (R, C) or (S, R, C)
          the original static image from which the current static image was
          generated, the current static image is the one that was provided
          via 'set_static_image(...)', which may not be the same as the
          original static image but a warped version of it (even the static
          image changes during Symmetric Normalization, not only the moving
          one).
      transformation : DiffeomorphicMap object
          the transformation that was applied to the original_static_image
          to generate the current static image
      """
      self.static_image_mask = (original_static_image > 0).astype(
          np.int32
      )
      if transformation is None:
          return
      shape = np.array(self.static_image.shape, dtype=np.int32)
      affine = self.static_affine
      self.static_image_mask = transformation.transform(
          self.static_image_mask, "nearest", None, shape, affine
      )
  
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 10 for calling the EMMetric obj's underlying member method code with example usage: obj.use_static_image_dynamics(original_static_image, transformation) without return types