class_docstr: A controller for the BinaryMatrix setting
      
class_docstr_tok: ["A","controller","for","the","BinaryMatrix","setting"]
code: def on_height_changed(self, event):
      matrix = self.setting.get_matrix()
      h, w = self.setting.get_size()
      d = self.height_ctrl.GetValue() * 2 + 1 - h
      n = abs(int(d / 2))
      if d < 0:
          matrix = matrix[n:-n]
      elif d > 0:
          matrix = (
              [[False] * w for _ in range(n)]
              + matrix
              + [[False] * w for _ in range(n)]
          )
      else:
          return
      value = BinaryMatrix.to_value(matrix)
      self.module_view.on_value_change(
          self.setting, self.panel, value, event
      )
  
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 8 for calling the BinaryMatrixController obj's underlying member method code with example usage: obj.on_height_changed(event) without return types