# How to use the slice command to visualize one image into two intersecting planes?

Hi, I need to visualize one image in two intersecting planes. The attached picture shows an example of what I want to do. However, it uses an equation (V = X.*exp(-X.^2-Y.^2-Z.^2) while I want to insert my image instead.

[X,Y,Z] = meshgrid(-2:.2:2);

V = X.*exp(-X.^2-Y.^2-Z.^2);

xslice = 0;

yslice = ;

zslice = 0;

slice(X,Y,Z,V,xslice,yslice,zslice)
I’m using MATLAB but if it is easier to do it using 3D slice or any other software that will be fine for me.

Operating system:Windows
Expected behavior:

Actual behavior:

You can fill an array based on a 3D function in Python very similar as in Matlab, and then you can visualize the volume in Slicer by a few more additional lines:

``````# Create 3D array V containing 3D function value
import numpy as np
X, Y, Z = np.meshgrid(np.arange(-2, 2, 0.2), np.arange(-2, 2, 0.2), np.arange(-2, 2, 0.2))
V = -X**2-Y**2-Z**2

# Create a Slicer volume node form the numpy array
slicer.util.updateVolumeFromArray(volumeNode, V)