docstr: Define a grid based on the coordinates of two points
  
  Returns a CPGridInfo object
docstr_tok: ["Define","a","grid","based","on","the","coordinates","of","two","points","Returns","a","CPGridInfo","object"]
code: def run_coordinates(self, workspace):
      """Define a grid based on the coordinates of two points
  
      Returns a CPGridInfo object
      """
      if self.display_image_name.value in workspace.image_set.names:
          image = workspace.image_set.get_image(
              self.display_image_name.value
          )
          shape = image.pixel_data.shape[:2]
      else:
          shape = None
      return self.build_grid_info(
          self.first_spot_coordinates.x,
          self.first_spot_coordinates.y,
          self.first_spot_row.value,
          self.first_spot_col.value,
          self.second_spot_coordinates.x,
          self.second_spot_coordinates.y,
          self.second_spot_row.value,
          self.second_spot_col.value,
          shape,
      )
  
imports: import logging
  import centrosome.cpmorphology
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Coordinates
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import GridName
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
  from cellprofiler_core.utilities.grid import Grid
label_desc: Use image node_id 7 for calling the DefineGrid obj's underlying member method code with example usage: obj.run_coordinates(workspace) and returns: self