#NEWLINE# def test_tps_apply( ) : #NEWLINE# #INDENT# src = PointCloud ( np . array ( [ [ ( - 1.0 ) , ( - 1.0 ) ] , [ ( - 1 ) , 1 ] , [ 1 , ( - 1 ) ] , [ 1 , 1 ] ] ) ) #NEWLINE# tgt = PointCloud ( np . array ( [ [ ( - 2.0 ) , ( - 2.0 ) ] , [ ( - 2 ) , 2 ] , [ 2 , ( - 2 ) ] , [ 2 , 2 ] ] ) ) #NEWLINE# pts = PointCloud ( np . array ( [ [ ( - 0.1 ) , ( - 1.0 ) ] , [ ( - 0.5 ) , 1.0 ] , [ 2.1 , ( - 2.5 ) ] ] ) ) #NEWLINE# tps = ThinPlateSplines ( src , tgt ) #NEWLINE# result = tps . apply ( pts ) #NEWLINE# expected = np . array ( [ [ ( - 0.2 ) , ( - 2.0 ) ] , [ ( - 1.0 ) , 2.0 ] , [ 4.2 , ( - 5.0 ) ] ] ) #NEWLINE# assert_allclose ( tgt . points , expected )