This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Explore 3-D Volumetric Data with Volume Viewer App

This example shows how to look at and explore 3-D volumetric data using the Volume Viewer app. Volume rendering is highly dependent on defining an appropriate alphamap so that structures in your data that you want to see are opaque and structures that you do not want to see are transparent. To illustrate, the example loads an MRI study of the human head into the Volume Viewer and explores the data using the visualization capabilities of the Volume Viewer.

Load Volume Data into the Volume Viewer

This part of the example shows how to load volumetric data into the Volume Viewer.

Load the MRI data of a human head from a MAT-file into the workspace. This operation creates a variable named D in your workspace that contains the volumetric data. Use the squeeze command to remove the singleton dimension from the data.

load mri

D = squeeze(D);

whos
Name        Size                 Bytes  Class     Attributes

  D         128x128x27            442368  uint8               
  map        89x3                   2136  double              
  siz         1x3                     24  double    

Open the Volume Viewer app. From the MATLAB® Tool strip, open the Apps tab and under Image Processing and Computer Vision, click . You can also open the app using the volumeViewer command.

Load volumetric data into Volume Viewer app. Click Load Volume. You can load an image by specifying its file name or load a variable from the workspace. If you have volumetric data in a DICOM format that uses multiple files to represent a volume, you can specify the DICOM folder name. Choose the Import From Workspace option because the data is in the workspace.

Select the workspace variable in the Import from Workspace dialog box and click OK.

View the Volume Data in the Volume Viewer

In this part of the example, you decide how you want to view your data. The Volume Viewer offers several options.

View the volume in the Volume Viewer app. By default, the Volume Viewer displays the data as a volume but you can also view it as slice planes. The MRI data displayed as a volume is recognizable as a human head. To explore the volume, zoom in and out on the image using the mouse wheel or a right-click. You can also rotate the volume by positioning the cursor in the image window, pressing and holding the mouse, and moving the cursor. You are always zooming or rotating around the center of the volume. The axes in the Orientation Axes window moves to reflect the spatial orientation of the image as you rotate it.

To change the background color used in the display window, click Background Color and select a color.

View the MRI data as a set of slice planes. Click Slice Planes. You can also zoom in and rotate this view of the data. Use the scroll bars in the three slice windows to view individual slices in any of the planes.

Continue used Volume Viewer capabilities until you achieve the best view of your data that.

View the Volume Data in the Volume Viewer

In this part of the example, you view the volumetric data in the Volume Viewer app.

Click Volume to return to viewing your data as a volume and use the capabilities of the Volume Viewer to get the best visualization of your data. The Volume Viewer provides several spatial referencing options that let you modify the view to get a more realistic view of the head volume (it appears flattened in the default view).

  • Specify Dimensions--You can specify the dimensions in the X, Y, and Z directions.

  • Upsample To Cube--The Volume Viewer calculates a scale factor that makes the number of samples in each dimension the same as the largest dimension in the volume. This setting can make non-isotropically sampled data appear scaled more correctly.

  • Use File Metadata--If the data file includes resolution data in its metadata, the Volume Viewer uses the metadata and displays the volume true to scale. The Volume Viewer selects the Use File Metadata option, by default, if metadata is present.

Refine the View with the Rendering Editor

This part of the example describes how to use the Volume Viewer rendering editor to modify your view of the data.

Refine the display, using Volume Viewer rendering options and the Rendering Editor.

Volume rendering is highly dependent on defining an appropriate alphamap so that structures you want to see are opaque and structures you don’t want to see are transparent. You define the opacity and transparency of voxel values throughout the volume, and choose the color mapping of these intensity values. The Volume Viewer offers a set of rendering presets that automatically set the alphamap and colormap to achieve certain well-defined effects. For example, to set a view that works well with CT bone data, click the CT Bone rendering preset. The Maximum Intensity Projection (MIP) presets look for the voxel with the highest intensity value for each ray projected through the data. MIP can be useful for revealing the highest intensity structure within a volume. When you select a rendering preset, the Rendering Editor presents the alphamap and colormap with that preset. By default, the Volume Viewer uses a simple linear relationship, but each preset changes the curve of the plot to give certain data value more or less opacity.

Edit the volume rendering in the Rendering Editor. The Rendering Editor controls the relationship between voxel intensity, opacity, and color. For example, if you want to lighten up the rendering of the head MRI using Linear Grayscale, click in the colormap editor to create a new marker near the white end of the scale and then you can move the marker towards the dark end of the scale. In this way, you expand the number of pixel values that map to white. You can also manipulate the alphamap to change the opacity mapping. If you click on the line, the Volume Viewer adds a marker

Continue used Volume Viewer capabilities until you achieve the best view of your data that.