Documentation Center

  • Trial Software
  • Product Updates

View Image Sequences in Video Viewer App

This section describes how to use the Video Viewer app to view image sequences and provides information about configuring the Video Viewer app.

View MRI Sequence Using Video Viewer App

  1. Load the image sequence into the MATLAB® workspace. For this example, load the MRI data from the file mristack.mat, which is included in the imdata folder.

    load mristack

    This places a variable named mristack in your workspace. The variable is an array of 21 grayscale frames containing MRI images of the brain. Each frame is a 256-by-256 array of uint8 data.

    mristack       256x256x21       1276256     uint8
  2. Click the Video Viewer app in the apps gallery and select the Import from workspace option on the File menu. You can also call implay, specifying the name of the image sequence variable as an argument.

    implay(mristack)

    The Video Viewer opens, displaying the first frame of the image sequence. Note how the Video Viewer displays information about the image sequence, such as the size of each frame and the total number of frames, at the bottom of the window.

  3. Explore the image sequence using Video Viewer Playback controls.

    To view the image sequence or video as an animation, click the Play button in the Playback toolbar, select Play from the Playback menu, or press P or the Space bar. By default, the Video Viewer plays the image sequence forward, once in its entirety, but you can view the frames in the image sequence in many ways, described in this table. As you view an image sequence, note how the Video Viewer updates the Status Bar at the bottom of the window.

    Viewing OptionPlayback ControlKeyboard Shortcut
    Specify the direction in which to play the image sequence.Click the Playback mode button in the Playback toolbar or select Playback Modes from the Playback menu. You can select forward, backward, or autoreverse. As you click the playback mode button, it cycles through these options and the appearance changes to indicate the current selection. A
    View the sequence repeatedly.Click the Repeat button in the Playback toolbar or select Playback Modes > Repeat from the Playback menu. You toggle this option on or off.R
    Jump to a specific frame in the sequence.Click the Jump to button in the Playback toolbar or select Jump to from the Playback menu. This option opens a dialog box in which you can specify the number of the frame. J
    Stop the sequence.Click the Stop button in the Playback toolbar or select Stop from the Playback menu. This button is only enabled when an image sequence is playing.S
    Step through the sequence, one frame at a time, or jump to the beginning or end of the sequence (rewind).Click one of the navigation buttons in the Playback toolbar, in the desired direction, or select an option, such as Fast Forward or Rewind from the Playback menu.

    Arrow keysPage Up/Page Down

    L (last frame) F (first frame)

  4. Change the view of the image sequence or examine a frame more closely.

    The Video Viewer supports several tools listed in the Tools menu and on the Toolbar that you can use to examine the frames in the image sequence more closely.

    Viewing OptionPlayback Control
    Zoom in or out on the image, and pan to change the view. Click one of the zoom buttons in the toolbar or select Zoom In or Zoom Out from the Tools menu. Click the Pan button in the toolbar or select Pan from the Tools menu. If you click Maintain fit to window button in the toolbar or select Maintain fit to window or from the Tools menu, the zoom and pan buttons are disabled.
    Examine an area of the current frame in detail. Click the Pixel region button in the Playback toolbar or select Pixel Region from the Tools menu.
    Export frame to Image ViewerClick the Export to Image Tool button in the Playback toolbar or select Export to Image Tool from the File menu. The Video Viewer app opens an Image Viewer containing the current frame.

Configure Video Viewer App

The Video Viewer app Configuration dialog box enables you to change the appearance and behavior of the player. To open the Configuration dialog box, select File > Configuration > Edit. (To load a preexisting configuration set, select File > Configuration > Load.)

The Configuration dialog box contains four tabs: Core, Sources, Visuals, and Tools. On each tab, select a category and then click Properties to view configuration settings.

The following table lists the options that are available for each category on every pane.

PaneOption CategoryOption Descriptions
CoreGeneral UI

Display the full source path in the title bar check box — Select to display the full path to the video data source in the title bar. By default, Movie Player displays a shortened name in the title bar.

Open message log menu — Specify when the Message log window opens. You can use the Message log window to debug issues with video playback. By default, the window only opens for failure messages.

CoreSource UI

Keyboard commands respect playback mode check box — Select to make keyboard shortcut keys aware of your playback mode selection. If you clear this check box, the keyboard shortcut keys behave as if the playback mode is set to Forward play and Repeat is set to off.

Recently used sources list parameter — Specifies the number of sources listed in the File menu.

SourcesSimulink

Select the Enabled check box to enable connections to Simulink models. You must have Simulink installed.

SourcesFile

Select the Enabled check box to enable connections to files (the default).

Default open file path parameter — Specify the directory that is displayed in the Connect to File dialog box when you click File > Open.

SourcesWorkspace

Select the Enabled check box to enable connections to variables in the workspace (the default). There are no options associated with this selection.

VisualsVideoSelect the Enabled check box to use video visualization.
ToolsImage Tool Select the Enabled check box to include the Image Viewer.

Open new Image Tool window for each export check box — Opens a new Image Viewer for each exported frame.

ToolsPixel RegionSelect the Enabled check box to include the Pixel Region tool in the Video Viewer app (the default).
ToolsImage Navigation ToolsSelect the Enabled check box to include the zoom and pan tools in the Video Viewer app (the default).
ToolsInstrumentation SetsSelect the Enabled check box to include instrumentation sets in the Video Viewer app. Provides a way to save your current configuration.

Save Image Viewer App Configuration Settings

To save your configuration settings for future use, select File > Configuration Set > Save as.

    Note:   By default, the Video Viewer uses the configuration settings from the file implay.cfg. If you want to store your configuration settings in this file, you should first create a backup copy of the file.

Specifying the Frame Rate

To decrease or increase the playback rate, select Frame Rate from the Playback menu, or use the keyboard shortcut T. The Frame Rate dialog box displays the frame rate of the source, lets you change the rate at which the Video Viewer app plays the image sequence or video, and displays the actual playback rate. The playback rate is the number of frames the Video Viewer processes per second.

If you want to increase the actual playback rate, but your system's hardware cannot keep up with the desired rate, select the Allow frame drop to achieve desired playback rate check box. This parameter enables the Video Viewer app to achieve the playback rate by dropping frames. When you select this option, the Frame Rate dialog box displays several additional options that you can use to specify the minimum and maximum refresh rates. If your hardware allows it, increase the refresh rate to achieve a smoother playback. However, if you specify a small range for the refresh rate, the computed frame replay schedule may lead to a choppy replay, and a warning will appear.

Specify Color Map

To specify the colormap to apply to the intensity values, select Colormap from the Tools menu, or use the keyboard shortcut C. The Video Viewer displays a dialog box that enables you to change the colormap.

Use the Colormap parameter to specify a particular colormap.

If you know that the pixel values do not use the entire data type range, you can select the Specify range of displayed pixel values check box and enter the range for your data. The dialog box automatically displays the range based on the data type of the pixel values.

Get Information about an Image Sequence

To view basic information about the image data, click the Video Information button in the Video Viewer toolbar or select Video Information from the Tools menu. The Video Viewer displays a dialog box containing basic information about the image sequence, such as the size of each frame, the frame rate, and the total number of frames.

Was this topic helpful?