code: def test_image_casts(self):
      one_target = numpy.ones((10, 10), dtype=numpy.float64)
      zero_target = numpy.zeros((10, 10), dtype=numpy.float64)
      tests = [
          (numpy.float64, 0, 1.0),
          (numpy.float32, 0, 1.0),
          (numpy.uint32, 0, math.pow(2.0, 32.0) - 1),
          (numpy.uint16, 0, math.pow(2.0, 16.0) - 1),
          (numpy.uint8, 0, math.pow(2.0, 8.0) - 1),
          (numpy.int32, -math.pow(2.0, 31.0), math.pow(2.0, 31.0) - 1),
          (numpy.int16, -math.pow(2.0, 15.0), math.pow(2.0, 15.0) - 1),
          (numpy.int8, -math.pow(2.0, 7.0), math.pow(2.0, 7.0) - 1),
      ]
      for dtype, zval, oval in tests:
          x = cellprofiler_core.image.Image()
          x.set_image((one_target * zval).astype(dtype))
          assert (
              x.image == zero_target
          ).all(), "Failed setting %s to min" % (repr(dtype))
          x.set_image((one_target * oval).astype(dtype))
          y = x.image == one_target
          assert (
              x.image == one_target
          ).all(), "Failed setting %s to max" % (repr(dtype))
  
imports: import math
  import numpy
  import cellprofiler_core.image
label_desc: Use image node_id 6 for calling the TestImage obj's underlying member method code with example usage: obj.test_image_casts() without return types