parq_blockmodel.utils.pyvista.pyvista_utils.df_to_pv_image_data

parq_blockmodel.utils.pyvista.pyvista_utils.df_to_pv_image_data(df, geometry, fill_value=nan, categorical_encode=False, categorical_mappings=None)[source]

Convert a DataFrame to a PyVista ImageData object for a dense regular grid.

Parameters:
  • df (DataFrame) – DataFrame with MultiIndex (x, y, z) or columns x, y, z.

  • geometry (RegularGeometry) – RegularGeometry instance (provides shape, spacing, origin).

  • fill_value – Value to use for missing cells.

  • categorical_encode (bool) – Whether to encode categorical columns.

  • categorical_mappings (dict[str, dict]) – Mapping of categorical column names to integers. If None, will auto-generate.

Returns:

PyVista ImageData object with cell data.

Return type:

pv.ImageData