def test_2d_coordinates(self): cropped_map = np.zeros((256, 512, 1)) img_size = [8, 9, 1] win_size = [8, 8, 1] coords = rand_spatial_coordinates(64, img_size, win_size, None) self.assertAllEqual(coords.shape, (64, N_SPATIAL)) self.assertCoordinatesAreValid(coords, img_size, win_size)
def test_3d_coordinates(self): img_size = [8, 9, 10] win_size = [7, 9, 4] coords = rand_spatial_coordinates( 32, img_size, win_size, None) self.assertAllEqual(coords.shape, (32, N_SPATIAL)) self.assertCoordinatesAreValid(coords, img_size, win_size)
def test_1d_coordinates(self): cropped_map = np.zeros((1, 1, 1)) img_size = [4, 1, 1] win_size = [2, 1, 1] coords = rand_spatial_coordinates(20, img_size, win_size, None) print(coords) self.assertAllEqual(coords.shape, (20, N_SPATIAL)) self.assertCoordinatesAreValid(coords, img_size, win_size)