{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Each column contains either a scalar property, an object property, or an element in a multidimensional array."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Properties with scalar values for each region, such as \"eccentricity\", will appear as a float or int array with that property name as key."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Multidimensional properties "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "of fixed size"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for a given image dimension, such as \"centroid\" (every centroid will have three elements in a 3D image, no matter the region size), will be split into that many columns, with the name {property_name}{separator}{element_num} (for 1D properties), {property_name}{separator}{elem_num0}{separator}{elem_num1} (for 2D properties), and so on."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For multidimensional properties that don't have a fixed size, such as \"image\" (the image of a region varies in size depending on the region size), an object array will be used, with the corresponding property name as the key."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out_dict",
              "annotation": "dict",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Dictionary mapping property names to an array of values of that property, one value per region. This dictionary can be used as input to pandas "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "DataFrame"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to map property names to columns in the frame and regions to rows. If the image has no regions, the arrays will have length 0, but the correct type."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Compute region properties and return them as a pandas-compatible table."
            }
          ]
        }
      ],
      "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": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "label_image",
              "annotation": "(M, N[, P]) ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Label image. Labels with value 0 are ignored."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "intensity_image",
              "annotation": "(M, N[, P][, C]) ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Intensity (input) image of same shape as label image, plus optionally an extra dimension for multichannel data. The channel dimension, if present, must be the last axis. Default is None."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionchanged",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionchanged 0.18.0"
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "The ability to provide an extra dimension for channels was added."
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "properties",
              "annotation": "tuple or list of str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Properties that will be included in the resulting dictionary For a list of available properties, please see "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "regionprops",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "skimage.measure._regionprops:regionprops"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Users should remember to add \"label\" to keep track of region identities."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "cache",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Determine whether to cache calculated properties. The computation is much faster for cached properties, whereas the memory consumption increases."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "separator",
              "annotation": "str, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "For non-scalar properties not listed in OBJECT_COLUMNS, each element will appear in its own column, with the index of that element separated from the property name by this separator. For example, the inertia tensor of a 2D region will appear in four columns: "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "inertia_tensor-0-0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "inertia_tensor-0-1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "inertia_tensor-1-0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "inertia_tensor-1-1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (where the separator is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "-"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ")."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Object columns are those that cannot be split in this way because the number of columns would change depending on the object. For example, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "image"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "coords"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "extra_properties",
              "annotation": "iterable of callables",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Add extra property computation functions that are not included with skimage. The name of the property is derived from the function name, the dtype is inferred by calling the function on a small sample. If the name of an extra property clashes with the name of an existing property the extra property will not be visible and a UserWarning is issued. A property computation function must take a region mask as its first argument. If the property requires an intensity image, it must accept the intensity image as the second argument."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "spacing",
              "annotation": "tuple of float, shape (ndim,)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The pixel spacing along each axis of the image."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The return value is a dictionary mapping property names to value arrays. This dictionary can be used as input to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "pandas.DataFrame"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to result in a \"tidy\" "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " table with one region per row and one property per column."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Use this function typically when you want to do downstream data analysis, or save region data to disk in a structured way. One downside of this function is that it breaks multi-dimensional properties into independent columns; for example, the region centroids of a 3D image end up in three different columns, one per dimension. If you need to do complex computations with the region properties, using "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "skimage.measure.regionprops",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "skimage",
                "version": "*",
                "kind": "api",
                "path": "skimage.measure._regionprops:regionprops"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " might be more fitting."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionadded",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionadded 0.16"
                }
              ]
            }
          ]
        }
      ],
      "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/measure/_regionprops.py",
  "item_line": 974,
  "item_type": "function",
  "aliases": [
    "skimage.measure.regionprops_table"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from skimage import data, util, measure\nimage = data.coins()\nlabel_image = measure.label(image > 110, connectivity=image.ndim)\nprops = measure.regionprops_table(label_image, image,\n                          properties=['label', 'inertia_tensor',\n                                      'inertia_tensor_eigvals'])\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe resulting dictionary can be directly passed to pandas, if installed, to\nobtain a clean DataFrame:\n\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n[5 rows x 7 columns]\n\nIf we want to measure a feature that does not come as a built-in\nproperty, we can define custom functions and pass them as\n``extra_properties``. For example, we can create a custom function\nthat measures the intensity quartiles in a region:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from skimage import data, util, measure\nimport numpy as np\ndef quartiles(regionmask, intensity):\n    return np.percentile(intensity[regionmask], q=(25, 50, 75))\nimage = data.coins()\nlabel_image = measure.label(image > 110, connectivity=image.ndim)\nprops = measure.regionprops_table(label_image, intensity_image=image,\n                                  properties=('label',),\n                                  extra_properties=(quartiles,))\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "label_image",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "intensity_image",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "properties",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "('label', 'bbox')"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "cache",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "True"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "separator",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "-"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "extra_properties",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "spacing",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "regionprops_table"
  },
  "references": [
    ".. [1] Wickham, H (2014) \"Tidy Data\" Journal of Statistical Software,",
    "       59(10), 1–23. https://doi.org/10.18637/jss.v059.i10",
    "       https://vita.had.co.nz/papers/tidy-data.pdf"
  ],
  "qa": "skimage.measure._regionprops:regionprops_table",
  "arbitrary": [],
  "local_refs": [
    "cache",
    "extra_properties",
    "intensity_image",
    "label_image",
    "out_dict",
    "properties",
    "separator",
    "spacing"
  ]
}