Skip to content

ParaView Plugin

MicPy provides a plugin that allows MICRESS simulation data to be loaded and explored directly inside ParaView.

Once the plugin is installed, MICRESS-generated datasets, such as concentration or phase fields stored in MICRESS binary files, can be opened in ParaView without any additional conversion steps, enabling interactive exploration, filtering, and visualization using ParaView's native tools.

Phase interfaces visualized in ParaView via a 0.5 iso-surface contour of MICRESS phase fraction data (A019_02_MgAl6_E_Dendritic_3D_TQ.frac).

Requirements

To use the MicPy ParaView plugin, ParaView must be able to access the MicPy Python package at runtime. The simplest way to ensure this is to run ParaView from a dedicated conda environment in which MicPy is installed.

The following instructions describe a recommended setup using conda and pip.

Installation

1. Create a conda environment with ParaView and MicPy

First, create a new conda environment for ParaView and MicPy. Make sure to select a Python version that is compatible with both ParaView and MicPy.

# Install ParaView and Python in a new conda environment
conda create -y -n micpy-pv -c conda-forge paraview=5.13 python=3.10

# Activate the environment
conda activate micpy-pv

# Install MicPy via pip
pip install micress-micpy==0.4
# Install ParaView and Python in a new conda environment
conda create -y -n micpy-pv -c conda-forge paraview=5.12 python=3.10

# Activate the environment
conda activate micpy-pv

# Install MicPy via pip
pip install micress-micpy==0.4
# Install ParaView and Python in a new conda environment
conda create -y -n micpy-pv -c conda-forge paraview=5.11 python=3.9

# Activate the environment
conda activate micpy-pv

# Install MicPy via pip
pip install micress-micpy==0.4
# Install ParaView and Python in a new conda environment
conda create -y -n micpy-pv -c conda-forge paraview=6.0 python=3.12

# Activate the environment
conda activate micpy-pv

# Install MicPy via pip
pip install micress-micpy==0.4

At this point, ParaView's Python interpreter (when launched from this environment) will be able to import MicPy.

2. Loading the plugin in ParaView

Once ParaView and MicPy are installed in the same environment, the plugin can be loaded in one of two ways:

  1. Activate the conda environment:
    conda activate micpy-pv
    
  2. Launch ParaView:
    paraview
    
  3. In ParaView, open Tools → Manage Plugins…
  4. Click Load New… and select the MicPy.py plugin file located in the MicPy installation directory (site-packages). You can find the exact path by running the following command in the same conda environment:
    python -c "import micpy.bin as b; print(b.pv_plugin_path())"
    
  5. (Optional) Enable Auto Load to load the plugin automatically in future sessions

ParaView can automatically discover plugins if their directory is listed in the PV_PLUGIN_PATH environment variable.

MicPy provides a helper function to locate the plugin file:

python -c "import micpy.bin as b; print(b.pv_plugin_path())"

Set PV_PLUGIN_PATH on the conda environment using:

conda env config vars set PV_PLUGIN_PATH="$(python -c "import micpy.bin as b; print(b.pv_plugin_path())")"

Reactivate the environment to apply the change:

conda deactivate
conda activate micpy-pv

When ParaView is launched from this environment, the plugin will be discovered and loaded automatically.