Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pmi432 / LR07 / 2read / image processing toolbox guide.pdf
Скачиваний:
166
Добавлен:
18.03.2015
Размер:
18.08 Mб
Скачать

4 Displaying and Exploring Images

Viewing Image Sequences

In this section...

“Overview” on page 4-54

“Viewing Image Sequences in the Movie Player” on page 4-54 “Viewing Image Sequences as a Montage” on page 4-63 “Converting a Multiframe Image to a Movie” on page 4-64

Overview

Some applications create collections of images related by time, such as frames in a movie, or by (spatial location, such as magnetic resonance imaging (MRI) slices. These collections of images are referred to by a variety of names, such as image sequences, image stacks, or videos.

The toolbox represents image sequences as four-dimensional arrays, where each separate image is called a frame, all frames are the same size, and the frames are concatenated along the fourth dimension. imtool and imshow can display one frame at a time, using standard MATLAB array indexing syntax, but cannot animate the sequence or provide any navigation within the sequence. A better choice to view image sequences is the Movie Player (implay). The Movie Player can animate the display of frames in an image sequence and provides playback controls that you can use to navigate among the frames in the sequence. To get a static view of all the frames in an image sequence at one time, use the montage function. For more information, see these additional topics.

“Viewing Image Sequences in the Movie Player” on page 4-54

“Viewing Image Sequences as a Montage” on page 4-63.

“Converting a Multiframe Image to a Movie” on page 4-64

Viewing Image Sequences in the Movie Player

This section describes how to use the Movie Player to view image sequences and provides information about configuring the Movie Player.

“Example: Viewing a Sequence of MRI Images” on page 4-55

4-54

Viewing Image Sequences

“Configuring the Movie Player” on page 4-58

“Specifying the Frame Rate” on page 4-61

“Specifying the Color Map” on page 4-62

“Getting Information about the Image Frame” on page 4-62

Example: Viewing a Sequence of MRI Images

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

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

2View the image sequence in the Movie Player. Call implay, specifying the name of the image sequence variable as an argument. You can also specify the name of a file that contains an image sequence, such as an Audio Video Interleaved (AVI) file.

implay(mristack)

You can also import an image sequence from the workspace into the Movie Player using the Import from workspace option on the File menu.

The Movie Player opens, displaying the first frame of the image sequence. Note how the Movie Player 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.

4-55

4 Displaying and Exploring Images

Toolbar

Playback toolbar

Movie frames

 

 

 

 

 

Current frame/

Player

Frame type

Frame

Frame rate

total frames

status

(I or RGB)

size

and percentage

Note: + and -

 

 

 

of frame rate

 

 

 

indicate playback

 

 

 

achieved

 

 

 

direction.

 

 

 

 

 

3Explore the image sequence using Movie Player 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 Movie Player 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 Movie Player updates the Status Bar at the bottom of the window.

4-56

Viewing Image Sequences

 

Viewing

Playback Control

 

 

Keyboard

 

 

Option

 

 

 

Shortcut

 

 

Specify the

Click the Playback mode button

in the

A

 

 

direction in

 

 

 

Playback toolbar or select Playback Modes

 

 

 

which to play the

 

 

 

from the Playback menu. You can select

 

 

 

image sequence.

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.

 

 

 

View the

Click the Repeat button in the Playback

R

 

 

sequence

toolbar or select Playback Modes > Repeat

 

 

 

repeatedly.

from the Playback menu. You toggle this

 

 

 

 

option on or off.

 

 

 

 

 

Jump to a specific

Click the Jump to button

in the Playback

J

 

 

frame in the

toolbar or select Jump to from the Playback

 

 

 

sequence.

 

 

 

menu. This option opens a dialog box in

 

 

 

 

which you can specify the number of the

 

 

 

 

frame.

 

 

 

 

 

Stop the

Click the Stop button

in the Playback

S

 

 

sequence.

toolbar or select Stop from the Playback

 

 

 

 

menu. This button is only enabled when an

 

 

 

 

image sequence is playing.

 

 

 

 

Step through the

Click one of the navigation buttons

 

Arrow

 

 

sequence, one

in the Playback toolbar, in the

keysPage

 

 

frame at a time,

Up/Page

 

 

desired direction, or select an option, such

 

 

or jump to the

Down

 

 

as Fast Forward or Rewind from the

 

 

beginning or end

 

 

 

Playback menu.

 

 

L (last

 

 

of the sequence

 

 

 

 

 

 

 

frame)

 

 

(rewind).

 

 

 

 

 

 

 

 

F (first

 

 

 

 

 

 

 

 

 

 

 

 

frame)

 

 

 

 

 

 

 

 

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

4-57

Соседние файлы в папке 2read