def test_segmentation_to_objects_scale(scale): """Test anisotropic scaling.""" img, centroids = _make_test_image() objects = utils.segmentation_to_objects(img[np.newaxis, ...], scale=scale) _validate_centroids(centroids, objects, scale)
def test_segmentation_to_objects_type_generator(): """Test generator as input.""" generator = _example_segmentation_generator() objects = utils.segmentation_to_objects(generator) assert all([isinstance(o, btypes.PyTrackObject) for o in objects])
def test_segmentation_to_objects(ndim, nobj, binary): """Test different types of segmentation images.""" img, centroids = _make_test_image(ndim=ndim, nobj=nobj, binary=True) objects = utils.segmentation_to_objects(img[np.newaxis, ...]) _validate_centroids(centroids, objects)
def test_segmentation_to_objects_type(): """Test that btrack objects are returned.""" img, centroids = _make_test_image() objects = utils.segmentation_to_objects(img[np.newaxis, ...]) assert all([isinstance(o, btypes.PyTrackObject) for o in objects])