{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "user_guide:getting_started",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "scikit-image"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is an image processing Python package that works with "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "numpy",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "numpy",
                "version": "*",
                "kind": "api",
                "path": "numpy"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " arrays. The package is imported as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "skimage"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ":       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import skimage as ski",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Most functions of "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "skimage"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are found within submodules:       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> camera = ski.data.camera()",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "A list of submodules and functions is found on the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "API reference"
                }
              ],
              "url": "https://scikit-image.org/docs/stable/api/api.html",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " webpage."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Within scikit-image, images are represented as NumPy arrays, for example 2-D arrays for grayscale 2-D images       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> type(camera)\n<type 'numpy.ndarray'>\n>>> # An image with 512 rows and 512 columns\n>>> camera.shape\n(512, 512)",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "skimage.data",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "skimage",
                "version": "*",
                "kind": "api",
                "path": "skimage.data"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " submodule provides a set of functions returning example images, that can be used to get started quickly on using scikit-image's functions:       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> coins = ski.data.coins()\n>>> threshold_value = ski.filters.threshold_otsu(coins)\n>>> threshold_value\n107",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Of course, it is also possible to load your own images as NumPy arrays from image files, using "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "skimage.io.imread",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "skimage",
                "version": "*",
                "kind": "api",
                "path": "skimage.io._io:imread"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ":       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import os\n>>> filename = os.path.join(ski.data_dir, 'moon.png')\n>>> moon = ski.io.imread(filename)",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If you need more control over how images are loaded, you may want to consider using one of the many external Python libraries that can read images into NumPy arrays. For example, "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "imageio"
                }
              ],
              "url": "https://imageio.readthedocs.io/en/stable/",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " :       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import imageio.v3 as iio3\n>>> filename = os.path.join(ski.data_dir, 'moon.png')\n>>> moon = iio3.imread(filename)",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Use "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "natsort"
                }
              ],
              "url": "https://pypi.org/project/natsort/",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to load multiple images       "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": ">>> import os\n>>> from natsort import natsorted, ns\n>>> list_files = os.listdir('.')\n>>> list_files\n['01.png', '010.png', '0101.png', '0190.png', '02.png']\n>>> list_files = natsorted(list_files)\n>>> list_files\n['01.png', '02.png', '010.png', '0101.png', '0190.png']\n>>> image_list = []\n>>> for filename in list_files:\n...   image_list.append(ski.io.imread(filename))",
          "execution_status": null
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Getting started"
        }
      ],
      "level": 0,
      "target": null
    }
  ],
  "local_refs": []
}