montage
Display medical image slices or frames as montage in patient coordinates
Since R2023a
Syntax
Description
Medical Imaging Toolbox™ extends the functionality of the montage
(Image Processing Toolbox™) function to display data in a medicalImage
or
medicalVolume
object. If you do not have Medical Imaging Toolbox installed, see montage
(Image Processing Toolbox).
Medical Objects
montage(
displays all of the frames
in a medImage
)medicalImage
object as a rectangular montage. The function automatically adjusts display settings using
medicalImage
properties.
montage(
displays all of the
slices in a medVolume
)medicalVolume
object as a rectangular montage. The function automatically adjusts display settings using
medicalVolume
properties.
Nonmedical Image Formats
montage(
displays all of the frames of the
numeric array I
)I
.
montage(
displays a montage of images
specified in the cell array imagelist
)imagelist
. The images can be of different
types and sizes.
montage(
displays a montage of the images
specified in the image datastore imds
)imds
.
Additional Options
montage(___,
treats
grayscale and binary images as indexed images and displays them with the specified
colormap map
)map
, in addition to any input argument from a previous
syntax. If you specify images using a medicalImage
object,
medicalVolume
object, filenames, or an image datastore, then
map
overrides any internal colormap present in the object or image
files. montage
does not modify the colormap of RGB images.
montage(___,
uses
name-value pair arguments to customize the display of the image montage.Name=Value
)
returns a
handle to the single image object that contains all of the displayed images.img
= montage(___)
Examples
Input Arguments
Output Arguments
Tips
If you specify an indexed image, then
montage
converts it to RGB using the colormap present in the file.If there is a data type mismatch between images, then the
montage
function converts all images to data typedouble
using theim2double
function.When calculating the number of images to display horizontally and vertically,
montage
considers the aspect ratio of the images, so that the displayed montage is nearly square.Figure titles can appear cut off in the Live Editor. To ensure the whole title is visible, set the
PositionContraint
property of the parentAxes
object to"outerposition"
. Update the property value after you call themontage
function and before you call thetitle
function.If you specify the parent axes using theI = imread("peppers.png"); montage({I,I}) ax = gca; ax.PositionConstraint = "outerposition"; title("Peppers");
Parent
name-value argument, set thePositionConstraint
property of the specified parentAxes
object. For more details about axes position properties, see Control Axes Layout.
Version History
Introduced in R2023a