code: def test_02_half_circle_zernike():
      i, j = numpy.mgrid[-50:50, -50:50]
      ii, jj = [_.astype(float) + 0.5 for _ in (i, j)]
      labels = (numpy.sqrt(ii * ii + jj * jj) <= 40).astype(int)
      image = numpy.zeros(labels.shape)
      image[ii > 0] = 1
      m = run_module(
          image,
          labels,
          wants_zernikes=cellprofiler.modules.measureobjectintensitydistribution.Z_MAGNITUDES_AND_PHASE,
          zernike_degree=2,
      )
      for n_, m_, expected, delta in (
          (0, 0, 0.5, 0.001),
          (1, 1, 0.225, 0.1),
          (2, 0, 0, 0.01),
          (2, 2, 0, 0.01),
      ):
          ftr = "_".join(
              (
                  cellprofiler.modules.measureobjectintensitydistribution.M_CATEGORY,
                  cellprofiler.modules.measureobjectintensitydistribution.FF_ZERNIKE_MAGNITUDE,
                  IMAGE_NAME,
                  str(n_),
                  str(m_),
              )
          )
          assert abs(m[OBJECT_NAME, ftr][0] - expected) < delta
      ftr = "_".join(
          (
              cellprofiler.modules.measureobjectintensitydistribution.M_CATEGORY,
              cellprofiler.modules.measureobjectintensitydistribution.FF_ZERNIKE_PHASE,
              IMAGE_NAME,
              "1",
              "1",
          )
      )
      phase_i_1_1 = m[OBJECT_NAME, ftr][0]
      image = numpy.zeros(labels.shape)
      image[jj > 0] = 1
      m = run_module(
          image,
          labels,
          wants_zernikes=cellprofiler.modules.measureobjectintensitydistribution.Z_MAGNITUDES_AND_PHASE,
          zernike_degree=1,
      )
      phase_j_1_1 = m[OBJECT_NAME, ftr][0]
      assert (
          numpy.abs(numpy.abs(phase_i_1_1 - phase_j_1_1) - numpy.pi / 2)
          == 0
      )
  
imports: import io
  import centrosome.propagate
  import numpy
  import scipy.stats
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  import cellprofiler.modules.measureobjectintensitydistribution
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 18 for calling a global function with example usage: test_02_half_circle_zernike() without return types