# Examples from pyvista.ImageDataFilters.cells_to_points
# ======================================================

# Load an image with cell data.
from pyvista import examples
image = examples.load_uniform()

# Show the current properties and cell arrays of the image.
image

image.cell_data.keys()

# Re-mesh the cells and cell data as points and point data.
points_image = image.cells_to_points()

# Show the properties and point arrays of the re-meshed image.
points_image

points_image.point_data.keys()

# Observe that:

# - The input cell array is now a point array
# - The output has one less array (the input point data is ignored)
# - The dimensions have decreased by one
# - The bounds have decreased by half the spacing
# - The output `N Points` equals the input `N Cells`

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
