Get from Ico-github-logo

Highlights from
SC - powerful image rendering

  • autumn(varargin)
    AUTUMN Red-yellow colormap
  • bled(varargin)
    BLED Black to red variation of the hsv colormap
  • bone(varargin)
    BONE Black-blue-white colormap
  • bright(varargin)
    BRIGHT Black-bright-white colormap
  • cold(varargin)
    COLD Black-blue-cyan-white colormap
  • colormap_helper(map, len,...
    COLORMAP_HELPER Helper function for colormaps
  • cool(varargin)
    COOL Cyan-magenta colormap
  • copper(varargin)
    COPPER Black-copper colormap
  • copper2(varargin)
    COPPER2 Black-copper-white colormap
  • disco(varargin)
    DISCO High contrast colormap with strong gradient discontinuities
  • disparity(varargin)
    DISPARITY High contrast colormap with subtle gradient discontinuities
  • dusk(varargin)
    DUSK Black-blue-green-gray-red-yellow-white colormap
  • earth(varargin)
    EARTH Black-green-white colormap
  • gray(varargin)
    GRAY Black-white colormap
  • hicontrast(varargin)
    HICONTRAST Black-blue-red-magenta-green-cyan-yellow-white colormap
  • hot(varargin)
    HOT Black-red-yellow-white colormap
  • hsv(varargin)
    HSV Red-yellow-green-cyan-blue-magenta-red colormap
  • hsv2(varargin)
    HSV2 Black to red variation of the hsv colormap
  • imdisp(I, varargin)
    IMDISP Display one or more images nicely
  • imsc(varargin)
    IMSC Wrapper function to SC which replicates display behaviour of IMAGESC
  • jet(varargin)
    JET Variant of HSV colormap
  • pastel(varargin)
    PASTEL Black-pastel-white colormap
  • pink(len, varargin)
    PINK Black-pink-white colormap
  • pink2(varargin)
    PINK2 Black-pink-white colormap
  • real2rgb(A, cmap, lims)
    REAL2RGB Converts a real-valued matrix into a truecolor image
  • rescale(A, lims, out_lims)
    RESCALE Linearly rescale values in an array
  • sc(I, varargin)
    SC Display/output truecolor images with a range of colormaps
  • sepia(varargin)
    SEPIA Black-brown-white colormap
  • spring(varargin)
    SPRING Magenta-yellow colormap
  • summer(varargin)
    SUMMER Green-yellow colormap
  • temp(varargin)
    TEMP Blue-pale-dark red colormap
  • thermal(varargin)
    THERMAL Black-purple-red-yellow-white colormap
  • whed(varargin)
    WHED White to red variation of the hsv colormap
  • winter(varargin)
    WINTER Blue-green colormap
  • View all files
image thumbnail

SC - powerful image rendering

by

 

04 Sep 2007 (Updated )

Useful tool for rendering and outputting information rich images

imsc(varargin)
%IMSC Wrapper function to SC which replicates display behaviour of IMAGESC
%
% Examples:
%   imsc(I, varargin)
%   imsc(x, y, I, varargin)
%   h = imsc(...)
%
% IN:
%    x - 1xJ vector of x-axis bounds. If x(1) > x(2) the image is flipped
%        left-right. If J > 2 then only the first and last values are used.
%        Default: [1 size(I, 2)].
%    y - 1xK vector of y-axis bounds. If y(1) > y(2) the image is flipped
%        up-down. If K > 2 then only the first and last values are used.
%        Default: [1 size(I, 1)].
%    I - MxNxC input image.
%    varargin - Extra input parameters passed to SC. See SC's help for more
%               information.
%
% OUT:
%    h - Handle of the image graphics object generated.
%
% See also IMAGESC, SC.

% Copyright: Oliver Woodford, 2010

function h = imsc(varargin)

% Check for x, y as first two inputs
if nargin > 2 && isvector(varargin{1}) && numel(varargin{1}) > 1 && isvector(varargin{2}) && numel(varargin{2}) > 1
    % Render
    [I clim map] = sc(varargin{3:end});
    % Display
    h = image(varargin{1}([1 end]), varargin{2}([1 end]), I);
else
    % Render
    [I clim map] = sc(varargin{:});
    % Display
    h = image(I);
end
% Fix up colormap, if there is one
if ~isempty(clim)
    set(h, 'CDataMapping', 'scaled');
    ha = get(h, 'Parent');
    set(ha, 'CLim', clim);
    set(get(ha, 'Parent'), 'Colormap', map);
end
% Don't display the handle if not requested
if nargout < 1
    clear h
end

Contact us