IMG
Displays single/multiple images with given titles. See examples for more details
******************** Quick Description ********************
ob: can be a 2D/3D numerica array or 1D cell with each cell as a 2D numeric matrix
label: empty [] OR string OR a 1D cell same length as the z direction of *ob*
******************** GUI instructions ********************
'd' OR 'right arrow': next image
'a' OR 'left arrow': previous image
'w' OR 'up arrow': first image
's' OR 'down arrow': last image
'c': close figure
******************** Examples: main ********************
img(ob1);
*****ob1: 2D/3D array
img(ob1, label1);
*****ob1: 2D/3D array
*****label1:
**********empty [] (if array is 3D, then title of each 2D frame will be 'frame: 1', 'frame: 2',...) OR
**********1D cell (each cell corresponding to each 2D frames) OR
**********a string (for all 2D frames)
img(ob1, label1, ob2, label2, ...);
*****ob1, ob2, ... have the same size in 3rd dimension (size(ob,3))
******************** Examples: modes ********************
img(___, 'size', [1,3]);
*****generates subplot(1,3,kk)
img(___, 'axes', 'off');
*****remove white space between axes
img(___, 'auto-pos', 'on');
*****sets the figure position so that the mode ('axes','off') actually removes all white space.
*****only works if 'axes' mode is at 'off'
img(___, 'abs', 'on');
*****only plot absolute values of given pixel value
*****set to 'off' if wishes to plot actual real values (negative and positive)
img(___, 'colormap', 'jet');
*****uses the colormap 'jet'
*****can be changed to any MATLAB colormap
******************** Remarks ********************
If label is a string, then DO NOT USE mode names, e.g., 'size','axes', etc.
******************** Custom Functions ********************
setAxes
cell2var
figsize
last updated 02/04/2018
Author: Andrew Yuan
Jianwei (John) Miao Coherent Imaging Group
University of California, Los Angeles
Copyright (c) 2017, All Rights Reserved
Cite As
Andrew Yuan (2024). IMG (https://www.mathworks.com/matlabcentral/fileexchange/64504-img), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
Tags
Acknowledgements
Inspired by: setAxes
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.