docstr: Find correlated pairs of foreground points at given offsets
  
  img1, img2 - binary images to be correlated
  numbering1, numbering2 - indexes to be returned for pairs
  oi, oj - offset for second image
  
  returns two vectors: index in first and index in second
docstr_tok: ["Find","correlated","pairs","of","foreground","points","at","given","offsets","img1",",","img2","-","binary","images","to","be","correlated","numbering1",",","numbering2","-","indexes","to","be","returned","for","pairs","oi",",","oj","-","offset","for","second","image","returns","two","vectors",":","index","in","first","and","index","in","second"]
code: def find_adjacent_one(img1, numbering1, img2, numbering2, oi, oj):
      """Find correlated pairs of foreground points at given offsets
  
      img1, img2 - binary images to be correlated
      numbering1, numbering2 - indexes to be returned for pairs
      oi, oj - offset for second image
  
      returns two vectors: index in first and index in second
      """
      i1, i2 = IdentifyDeadWorms.get_slices(oi)
      j1, j2 = IdentifyDeadWorms.get_slices(oj)
      match = img1[i1, j1] & img2[i2, j2]
      return numbering1[i1, j1][match], numbering2[i2, j2][match]
  
imports: import matplotlib.cm
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, M_NUMBER_OBJECT_NUMBER, FF_COUNT, COLTYPE_FLOAT, IMAGE, C_COUNT, C_LOCATION, C_NUMBER, FTR_CENTER_X, FTR_CENTER_Y, FTR_OBJECT_NUMBER
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.object import Objects, ObjectSet
  from cellprofiler_core.preferences import get_default_colormap
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import LabelName, Integer, Float
  from centrosome.cpmorphology import all_connected_components
  from centrosome.cpmorphology import fixup_scipy_ndimage_result
  from centrosome.cpmorphology import get_line_pts
  from scipy.ndimage import binary_erosion, binary_fill_holes
  from scipy.ndimage import mean
label_desc: Use image node_id 9 for calling the IdentifyDeadWorms obj's underlying member method code with example usage: obj.find_adjacent_one(img1, numbering1, img2, numbering2, oi, oj) and returns: numbering1,  numbering2