File Exchange

image thumbnail

getImagePlanes.m

version 1.0.0.1 (1.29 KB) by Brett Shoelson
Conveniently extract individual z-planes (e.g., RGB) from an image or axes with one line.

0 Downloads

Updated 01 Sep 2016

View License

Extract individual planes from an MxNx3 image, or from an axis containing an MxNx3 image.

[R,G,B] = getImagePlanes(I)
Extracts the individual (color) planes from the MxNx3 image specified in I. I may be an image or an axes containing a single MXNx3 image.
I (finally) grew tired of typing:
r = img(:,:,1);
g = img(:,:,2);
b = img(:,:,3);
Now, it's just:
[r,g,b] = getImagePlanes(img);
or
[r,g,b] = getImagePlanes(gca);

instead! Simple, but useful!

Comments and Ratings (0)

Updates

1.0.0.1

Updated license

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor