code: def test_estimate_affine_3d(array_like_input):
      ndim = 3
      src = np.random.random((25, ndim)) * 2 ** np.arange(7, 7 + ndim)
      matrix = np.array(
          [
              [4.8, 0.1, 0.2, 25],
              [0.0, 1.0, 0.1, 30],
              [0.0, 0.0, 1.0, -2],
              [0.0, 0.0, 0.0, 1.0],
          ]
      )
  
      if array_like_input:
          # list of lists for matrix and src coords
          src = [list(c) for c in src]
          matrix = [list(c) for c in matrix]
  
      tf = AffineTransform(matrix=matrix)
      dst = tf(src)
      dst_noisy = dst + np.random.random((25, ndim))
      if array_like_input:
          # list of lists for destination coords
          dst = [list(c) for c in dst]
      tf2 = AffineTransform(dimensionality=ndim)
      assert tf2.estimate(src, dst_noisy)
      # we check rot/scale/etc more tightly than translation because translation
      # estimation is on the 1 pixel scale
      matrix = np.asarray(matrix)
      assert_almost_equal(tf2.params[:, :-1], matrix[:, :-1], decimal=2)
      assert_almost_equal(tf2.params[:, -1], matrix[:, -1], decimal=0)
      _assert_least_squares(tf2, src, dst_noisy)
  
imports: import re
  import textwrap
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal
  from skimage.transform import AffineTransform, EssentialMatrixTransform, EuclideanTransform, FundamentalMatrixTransform, PiecewiseAffineTransform, PolynomialTransform, ProjectiveTransform, SimilarityTransform, estimate_transform, matrix_transform
  from skimage.transform._geometric import _GeometricTransform, _affine_matrix_from_vector, _center_and_normalize_points, _euler_rotation_matrix
label_desc: Use image node_id 42 for calling a global function with example usage: test_estimate_affine_3d(array_like_input) without return types