{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Euclidean transformation, also known as a rigid transform."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "params",
              "annotation": "ndarray of shape (K, K), with K=D+1 (D being the dimensionality)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Homogeneous transformation matrix."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "matrix",
              "annotation": "array_like of shape (K, K), with K=D+1 (D being the dimensionality), optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Homogeneous transformation matrix."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rotation",
              "annotation": "float or sequence of float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Rotation angle, clockwise, in radians. If given as a vector, it is interpreted as Euler rotation angles "
                    },
                    {
                      "__type": "FootnoteReference",
                      "__tag": 4066,
                      "label": "1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Only 2D (single rotation) and 3D (Euler rotations) values are supported. For higher dimensions, you must provide or estimate the transformation matrix instead, and pass that as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "matrix"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " above."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "translation",
              "annotation": "(x, y[, z, ...]) sequence of float, length D, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Translation parameters for each axis."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "dimensionality",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Fallback number of dimensions for transform when no other parameter is specified.  Otherwise ignored, and we infer dimensionality from the input parameters."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Has the following form      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "X = a0 * x - b0 * y + a1 =\n  = x * cos(rotation) - y * sin(rotation) + a1\n\nY = b0 * x + a0 * y + b1 =\n  = x * sin(rotation) + y * cos(rotation) + b1",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "where the homogeneous transformation matrix is      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "[[a0 -b0  a1]\n [b0  a0  b1]\n [0   0   1 ]]",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The Euclidean transformation is a rigid transformation with rotation and translation parameters. The similarity transformation extends the Euclidean transformation with a single scaling factor."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "In 2D and 3D, the transformation parameters may be provided either via "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "matrix"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the homogeneous transformation matrix, above, or via the implicit parameters "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "rotation"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and/or "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "translation"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (where "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "a1",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is the translation along "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "x",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "b1",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " along "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "y",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", etc.). Beyond 3D, if the transformation is only a translation, you may use the implicit parameter "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "translation"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "; otherwise, you must use "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "matrix"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The implicit parameters are applied in the following order:"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": true,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Rotation;"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Translation."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Returns",
    "Yields",
    "Receives",
    "Raises",
    "Warns",
    "Other Parameters",
    "Attributes",
    "Methods",
    "Notes",
    "Warnings"
  ],
  "item_file": "/dev/scikit-image/src/skimage/transform/_geometric.py",
  "item_line": 1813,
  "item_type": "ABCMeta",
  "aliases": [
    "skimage.transform.EuclideanTransform"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport skimage as ski\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDefine a transform with an homogeneous transformation matrix:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tform = ski.transform.EuclideanTransform(np.diag([2., 3., 1.]))\ntform.params\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDefine a transform with parameters:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "tform = ski.transform.EuclideanTransform(\n            rotation=0.2, translation=[1, 2])\nnp.round(tform.params, 2)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nYou can estimate a transformation to map between source and destination\npoints:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "src = np.array([[150, 150],\n                [250, 100],\n                [150, 200]])\ndst = np.array([[200, 200],\n                [300, 150],\n                [150, 400]])\ntform = ski.transform.EuclideanTransform.from_estimate(src, dst)\nnp.allclose(tform.params, [[ 0.99, 0.12,  16.77],\n                           [-0.12, 0.99, 122.91],\n                           [ 0.  , 0.  ,   1.  ]], atol=0.01)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nApply the transformation to some image data.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "img = ski.data.astronaut()\nwarped = ski.transform.warp(img, inverse_map=tform.inverse)\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe estimation can fail - for example, if all the input or output points\nare the same.  If this happens, you will get a transform that is not\n\"truthy\" - meaning that ``bool(tform)`` is ``False``:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "if tform:\n    print(\"Estimation succeeded.\")\nbad_src = np.ones((3, 2))\nbad_tform = ski.transform.EuclideanTransform.from_estimate(\n     bad_src, dst)\nif not bad_tform:\n    print(\"Estimation failed.\")\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTrying to use this failed estimation transform result will give a suitable\nerror:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "bad_tform.params  # doctest: +IGNORE_EXCEPTION_DETAIL\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "matrix",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "rotation",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "translation",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "dimensionality",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "EuclideanTransform"
  },
  "references": [
    ".. [1] https://en.wikipedia.org/wiki/Rotation_matrix#In_three_dimensions"
  ],
  "qa": "skimage.transform._geometric:EuclideanTransform",
  "arbitrary": [],
  "local_refs": [
    "dimensionality",
    "matrix",
    "params",
    "rotation",
    "translation"
  ]
}