4.84615

4.8 | 13 ratings Rate this file 97 downloads (last 30 days) File Size: 12.56 KB File ID: #16233

SC - powerful image rendering

by Oliver Woodford

 

04 Sep 2007 (Updated 17 Mar 2009)

Code covered by the BSD License  

Useful tool for rendering and outputting information rich images

Download Now | Watch this File

File Information
Description

SC is a useful function for displaying rich image data, of use to anyone wishing to visualize and save 2D data in ways beyond that which MATLAB built-in functions allow.

This function can be used in place of IMAGE, IMAGESC and IMSHOW, but does so much more. It is fast and displays images as they should be - correct aspect ratio, integer magnification, no axes. In addition, it can return the image as an output variable - useful for saving to disk, texture mapping surfaces, and post-rendering manipulation such as overlaying/combining two or more images.

All the MATLAB built-in colormaps are implemented, but without MATLAB's nasty discretization artifacts. Plus, there are many new colormaps which are helpful for viewing more complex data, such as optic flow, likelihoods over images, difference images, segmentations, stereo image pairs (as anaglyphs) and edge-maps with orientation. It also accepts user defined linear and non-linear colormaps.

SC comes with a complete demo, to help you get the most out of it. It doesn't require that you have any toolboxes, either.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (18)
14 Nov 2007 John Henkel

This is a pretty good package. I was just about to resort to either Zedgraph or Python to make some really pretty contour graphs (gotta pull out all the stops to get more funding. =P ), and ran across this. Very nice, and easy to use. The demo is a neat feature.

15 Nov 2007 p p

best viewing code ever

10 Jan 2008 Felix Hebeler

Excellent package, saved my day! Great support too! Highly recommended...

25 Mar 2008 Ross McGurk

Finally found a relatively simple tool for overlaying some deformation maps on a binary image.
Took me about half an hour to get it to do what I was hoping it would (and this was helped due one of the examples in the demo).

Thanks very much for making this available!

04 Sep 2008 Ernesto Moya

It's great.

15 Oct 2008 M HEMA NITHYA  
28 Jan 2009 Andrew

Perfect. I used it to get around the fact that Matlab only allows one colormap per figure axis, and with some trial and error I even got the colorbar I wanted to show up. Great work Oliver.

16 Mar 2009 C. Chaya

Doesn't show subplot titles. Must use

set(get(gca, 'Title'), 'Visible', 'on'); as a workaround.

16 Mar 2009 C. Chaya

Otherwise, an excellent job. would give it 4.5 stars if the rating system would let me.

17 Mar 2009 Oliver Woodford

Removing the axes is a "feature" of the display side of this code. Unfortunately it does mean subplot titles and axes labels are hidden. This is something I've tried hard to avoid, but haven't found a way yet. You can use IMSHOW instead, but still get the benefits of SC, thus:
   imshow(sc(X, 'jet'));

17 Mar 2009 Oliver Woodford

The problem with not displaying titles and axis labels has now been fixed, thanks to C. Chaya's suggestion.

18 Mar 2009 Yair Altman

Extremely well done: excellent documentation, very instructive online demo (look at its code: so clean and compact!), lots of boundary-condition checks and clever packing of lots of options into a decievingly-simple interface. Some of this submission's defaults should have been imagesc's as well (for example, auto preservation of aspect ratio & axes elimination, not to mention the discretization issues). I love it!

18 Mar 2009 Idillus

Nice

30 Apr 2009 Jun wan

veri nice .bue i didn't try it

12 Aug 2009 Justin

The autopreservation of aspect ratio (mentioned by http://www.mathworks.com/matlabcentral/fileexchange/authors/27420) is the only thing I don't like about sc If I have a very long narrow matrix, imagesc scales it to display it in a standard sized matlab window. sc on the other hand gives me an extremely long narrow window. If there's an easy way to disable this please let me know.

Otherwise it's great.

12 Aug 2009 Oliver Woodford

Justin - if you prefer the image displaying properties of imagesc I suggest you use image(sc(X)). However, you then don't get the correct colorbar. If it's just the aspect ratio you don't like then call set(gca, 'DataAspectRatioMode', 'auto') after sc.

12 Nov 2009 Ange  
10 Dec 2009 K E

Helpful, thanks

Please login to add a comment or rating.
Updates
05 Sep 2007

Improved description & title.
Added new Matlab colormaps to function.

05 Sep 2007

Improvements and a bug fix to the function

14 Sep 2007

Faster image display, numerous other improvements

18 Sep 2007

Fixed resize issue

24 Oct 2007

Reduced cyclic number of code.

26 Oct 2007

Updates seem to be revision behind.

15 Nov 2007

Added multiple screen support. Fixed truncation bug when displaying multiple images.

14 Jan 2008

Bug fix to 'prob_jet' colormap.

03 Mar 2008

Introduced 'flow' map, based on 'phase' map

04 Mar 2008

Bug fix to 'stereo'

04 Apr 2008

Fixed saturation issue with 'prob_jet'

16 Apr 2008

Added 'stereo_col'. Changed text a bit.

08 May 2008

Fixed saturation issue with 'phase'.
Leave axes on but make invisible, so TITLE etc. still work.

14 May 2008

Improved magnification to deal with images too large for the screen.

04 Jun 2008

Saves index of multi-image view on a figure-by-figure basis

10 Dec 2008

Added ability for users to define linear and non-linear colormaps. Added ability to combine images within SC. Removed ability to display multiple images, as it isn't key functionality.

16 Dec 2008

Fixed typo in the description!

17 Mar 2009

Allow axis labels and titles, using fix suggested by C. Chaya.

Tag Activity for this File
Tag Applied By Date/Time
plotting Oliver Woodford 22 Oct 2008 09:25:43
image Oliver Woodford 22 Oct 2008 09:25:43
overlay Oliver Woodford 22 Oct 2008 09:25:43
colormap Oliver Woodford 22 Oct 2008 09:25:43
colorbar Oliver Woodford 22 Oct 2008 09:25:43
intensity Oliver Woodford 22 Oct 2008 09:25:43
truecolor Oliver Woodford 22 Oct 2008 09:25:43
jet Oliver Woodford 22 Oct 2008 17:04:27
display Oliver Woodford 22 Oct 2008 17:04:46
output Oliver Woodford 22 Oct 2008 17:05:00
imagesc Oliver Woodford 22 Oct 2008 17:05:13
imshow Oliver Woodford 22 Oct 2008 17:05:19
imcapture Oliver Woodford 22 Oct 2008 17:05:39
render Oliver Woodford 22 Oct 2008 17:06:01
fuse Oliver Woodford 22 Oct 2008 17:07:10
save Oliver Woodford 23 Oct 2008 09:52:32
print Oliver Woodford 23 Oct 2008 09:52:38
export Oliver Woodford 23 Oct 2008 09:52:45
colormap Zhigang Xu 09 Dec 2008 12:43:27
mask Oliver Woodford 11 Dec 2008 14:35:10
nans Oliver Woodford 11 Dec 2008 14:35:10
image processing Oliver Woodford 11 Dec 2008 14:35:10
greyscale Oliver Woodford 23 Dec 2008 16:29:51
spectrum Oliver Woodford 23 Dec 2008 16:29:51
grayscale Oliver Woodford 23 Dec 2008 16:29:51
colour Oliver Woodford 23 Dec 2008 16:29:51
truecolour Oliver Woodford 23 Dec 2008 16:29:51
color Oliver Woodford 23 Dec 2008 16:29:51
rgb Oliver Woodford 23 Dec 2008 16:29:51
height Oliver Woodford 22 Jan 2009 06:34:52
height map Oliver Woodford 22 Jan 2009 06:34:52
deformation map Oliver Woodford 22 Jan 2009 06:34:52
render seonjoo irncjbra 29 Jan 2009 10:57:29
color learner little 22 Feb 2009 02:39:35
colormap Shaojie 31 Mar 2009 10:42:43
color Matthew 18 Feb 2010 10:25:19
saving picture after display imshow Renji 04 Mar 2010 07:39:20
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com