def testCircle_geometry(self): center = numpy.array([0, 0]) radius = 10. item = roi_items.CircleROI() item.setGeometry(center=center, radius=radius) numpy.testing.assert_allclose(item.getCenter(), center) numpy.testing.assert_allclose(item.getRadius(), radius)
def testCircle_contains(self): center = numpy.array([2, -1]) radius = 1. item = roi_items.CircleROI() item.setGeometry(center=center, radius=radius) self.assertTrue(item.contains([1, -1])) self.assertFalse(item.contains([0, 0])) self.assertTrue(item.contains([2, 0])) self.assertFalse(item.contains([3.01, -1]))