docstr: Adjust the offsets and shapes for output
  
  workspace - workspace passed to "run"
  
  offsets - i,j offsets for each image
  
  shapes - shapes of the input images
  
  names - pairs of input / output names
  
  Based on the crop mode, adjust the offsets and shapes to optimize
  the cropping.
docstr_tok: ["Adjust","the","offsets","and","shapes","for","output","workspace","-","workspace","passed","to","``","run","''","offsets","-","i",",","j","offsets","for","each","image","shapes","-","shapes","of","the","input","images","names","-","pairs","of","input","\/","output","names","Based","on","the","crop","mode",",","adjust","the","offsets","and","shapes","to","optimize","the","cropping","."]
code: def adjust_offsets(self, offsets, shapes):
      """Adjust the offsets and shapes for output
  
      workspace - workspace passed to "run"
  
      offsets - i,j offsets for each image
  
      shapes - shapes of the input images
  
      names - pairs of input / output names
  
      Based on the crop mode, adjust the offsets and shapes to optimize
      the cropping.
      """
      offsets = np.array(offsets)
      shapes = np.array(shapes)
      if self.crop_mode == C_CROP:
          # modify the offsets so that all are negative
          max_offset = np.max(offsets, 0)
          offsets = offsets - max_offset[np.newaxis, :]
          #
          # Reduce each shape by the amount chopped off
          #
          shapes += offsets
          #
          # Pick the smallest in each of the dimensions and repeat for all
          #
          shape = np.min(shapes, 0)
          shapes = np.tile(shape, len(shapes))
          shapes.shape = offsets.shape
      elif self.crop_mode == C_PAD:
          #
          # modify the offsets so that they are all positive
          #
          min_offset = np.min(offsets, 0)
          offsets = offsets - min_offset[np.newaxis, :]
          #
          # Expand each shape by the top-left padding
          #
          shapes += offsets
          #
          # Pick the largest in each of the dimensions and repeat for all
          #
          shape = np.max(shapes, 0)
          shapes = np.tile(shape, len(shapes))
          shapes.shape = offsets.shape
      return offsets.tolist(), shapes.tolist()
  
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 12 for calling the Align obj's underlying member method code with example usage: obj.adjust_offsets(offsets, shapes) and returns: offsets,  shapes