class_docstr: A controller for the BinaryMatrix setting
      
class_docstr_tok: ["A","controller","for","the","BinaryMatrix","setting"]
docstr: Return the i, j coordinates at the mouse
  
  returns i, j or None, None if misses the hit test
docstr_tok: ["Return","the","i",",","j","coordinates","at","the","mouse","returns","i",",","j","or","None",",","None","if","misses","the","hit","test"]
code: def hit_test(self, x, y):
      """Return the i, j coordinates at the mouse
  
      returns i, j or None, None if misses the hit test
      """
      bx, ex, dx, by, ey, dy = [
          wx.SystemSettings.GetMetric(m)
          for m in (
              wx.SYS_BORDER_X,
              wx.SYS_EDGE_X,
              wx.SYS_SMALLICON_X,
              wx.SYS_BORDER_Y,
              wx.SYS_EDGE_Y,
              wx.SYS_SMALLICON_Y,
          )
      ]
      i = int((y - ey) / (2 * ey + dy + by))
      j = int((x - ex) / (2 * ex + dx + bx))
      h, w = self.setting.get_size()
      if (
          i < 0
          or j < 0
          or i >= h
          or j >= w
          or not self.get_matrix_element_rect(i, j).Contains(x, y)
      ):
          return None, None
      return i, j
  
file_path: CellProfiler/src/frontend/cellprofiler/gui/module_view/_binary_matrix_controller.py
imports: import wx
  from cellprofiler_core.preferences import get_background_color
  from cellprofiler_core.setting import BinaryMatrix
  from ._module_view import ModuleView
  from ..utilities.module_view import edit_control_name
label_desc: Use image node_id 6 for calling the BinaryMatrixController obj's underlying member method code with example usage: obj.hit_test(x, y) and returns: i,  j, None,  None