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):wink: 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
Slicer version:I di not download it
Expected behavior:
112

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
volumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLScalarVolumeNode')
slicer.util.updateVolumeFromArray(volumeNode, V)

# Adjust visualization options
# Set color table to Viridis
volumeNode.CreateDefaultDisplayNodes()
volumeNode.GetDisplayNode().SetAndObserveColorNodeID('vtkMRMLColorTableNodeFileViridis.txt')
# Show volume in slice views
slicer.util.setSliceViewerLayers(background=volumeNode)

image

Thank you, Andras.
12
I want to use images instead of the plane equation. Please have a look at the attached picture.