{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The conceptual analogy of this operation is the 'paint bucket' tool in many raster graphics programs.  This function returns just the mask representing the fill."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If indices are desired rather than masks for memory reasons, the user can simply run "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "numpy.nonzero",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "numpy",
                "version": "*",
                "kind": "api",
                "path": "numpy:nonzero"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " on the result, save the indices, and discard this mask."
            }
          ]
        }
      ],
      "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": "mask",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A Boolean array with the same shape as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "image"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is returned, with True values for areas connected to and equal (or within tolerance of) the seed point.  All other values are False."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Mask corresponding to a flood fill."
            }
          ]
        }
      ],
      "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": "image",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An n-dimensional array."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "seed_point",
              "annotation": "tuple or int",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The point in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "image"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " used as the starting point for the flood fill.  If the image is 1D, this point may be given as an integer."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "footprint",
              "annotation": "ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The footprint (structuring element) used to determine the neighborhood of each evaluated pixel. It must contain only 1's and 0's, have the same number of dimensions as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "image"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If not given, all adjacent pixels are considered as part of the neighborhood (fully connected)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "connectivity",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A number used to determine the neighborhood of each evaluated pixel. Adjacent pixels whose squared distance from the center is less than or equal to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "connectivity"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are considered neighbors. Ignored if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "footprint"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not None."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "tolerance",
              "annotation": "float or int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If None (default), adjacent values must be strictly equal to the initial value of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "image"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " at "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "seed_point"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ".  This is fastest.  If a value is given, a comparison will be done at every point and if within tolerance of the initial value will also be filled (inclusive)."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Starting at a specific "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "seed_point"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", connected points equal or within "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "tolerance"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " of the seed value are found."
            }
          ]
        }
      ],
      "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/morphology/_flood_fill.py",
  "item_line": 129,
  "item_type": "function",
  "aliases": [
    "skimage.morphology.flood"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from skimage.morphology import flood\nimage = np.zeros((4, 7), dtype=int)\nimage[1:3, 1:3] = 1\nimage[3, 0] = 1\nimage[1:3, 4:6] = 2\nimage[3, 6] = 3\nimage\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFill connected ones with 5, with full connectivity (diagonals included):\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "mask = flood(image, (1, 1))\nimage_flooded = image.copy()\nimage_flooded[mask] = 5\nimage_flooded\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFill connected ones with 5, excluding diagonal points (connectivity 1):\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "mask = flood(image, (1, 1), connectivity=1)\nimage_flooded = image.copy()\nimage_flooded[mask] = 5\nimage_flooded\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFill with a tolerance:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "mask = flood(image, (0, 0), tolerance=1)\nimage_flooded = image.copy()\nimage_flooded[mask] = 5\nimage_flooded\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "image",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "seed_point",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "footprint",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "connectivity",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "tolerance",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "flood"
  },
  "references": null,
  "qa": "skimage.morphology._flood_fill:flood",
  "arbitrary": [],
  "local_refs": [
    "connectivity",
    "footprint",
    "image",
    "mask",
    "seed_point",
    "tolerance"
  ]
}