docstr: Align the second image with the first
  
  Calculate the alignment offset that must be added to indexes in the
  first image to arrive at indexes in the second image.
  
  Returns the x,y (not i,j) offsets.
docstr_tok: ["Align","the","second","image","with","the","first","Calculate","the","alignment","offset","that","must","be","added","to","indexes","in","the","first","image","to","arrive","at","indexes","in","the","second","image",".","Returns","the","x",",","y","(","not","i",",","j",")","offsets","."]
code: def align(self, workspace, input1_name, input2_name):
      """Align the second image with the first
  
      Calculate the alignment offset that must be added to indexes in the
      first image to arrive at indexes in the second image.
  
      Returns the x,y (not i,j) offsets.
      """
      image1 = workspace.image_set.get_image(input1_name)
      image1_pixels = image1.pixel_data.astype(float)
      image2 = workspace.image_set.get_image(input2_name)
      image2_pixels = image2.pixel_data.astype(float)
      if self.alignment_method == M_CROSS_CORRELATION:
          return self.align_cross_correlation(
              image1_pixels, image2_pixels
          )
      else:
          image1_mask = image1.mask
          image2_mask = image2.mask
          return self.align_mutual_information(
              image1_pixels, image2_pixels, image1_mask, image2_mask
          )
  
imports: import numpy
  import scipy.ndimage
  import scipy.sparse
  from centrosome.filter import stretch
  from scipy.fftpack import fft2, ifft2
  from ..constants.measurement import COLTYPE_INTEGER
  from ..image import Image
  from ..module import Module
  from ..setting import Divider, SettingsGroup
  from ..setting.choice import Choice
  from ..setting.do_something import DoSomething, RemoveSettingButton
  from ..setting.subscriber import ImageSubscriber
  from ..setting.text import ImageName
label_desc: Use image node_id 8 for calling the Align obj's underlying member method code with example usage: obj.align(workspace, input1_name, input2_name) and returns: self, self