image_levels

PURPOSE ^

IMAGE_LEVELS(img, levels, clim ) show slices at levels of an image

SYNOPSIS ^

function image_levels(img, levels, clim )

DESCRIPTION ^

 IMAGE_LEVELS(img, levels, clim  ) show slices at levels of an image
 img    = EIDORS image struct
 levels = array of vertical levels
  OR
 levels = [ [z_lev1 ,xpos,ypos], ...

 clim   = colourmap limit (or default if not specified)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function image_levels(img, levels, clim )
0002 % IMAGE_LEVELS(img, levels, clim  ) show slices at levels of an image
0003 % img    = EIDORS image struct
0004 % levels = array of vertical levels
0005 %  OR
0006 % levels = [ [z_lev1 ,xpos,ypos], ...
0007 %
0008 % clim   = colourmap limit (or default if not specified)
0009 
0010 % (C) 2005 Andy Adler. License: GPL version 2 or version 3
0011 % $Id: image_levels.html 2819 2011-09-07 16:43:11Z aadler $
0012 
0013 if exist('OCTAVE_VERSION');
0014    warning('image_levels does not support octave. Try show_slices');
0015 end
0016 
0017 set(gcf,'NumberTitle','off');
0018 set(gcf,'Name', img.name);
0019 fwd_mdl= img.fwd_model;
0020 vtx=  fwd_mdl.nodes;
0021 simp= fwd_mdl.elems;
0022 img_data = img.elem_data;
0023 
0024 fc= [];
0025 
0026 if size(levels,1)==3
0027    ll = size(levels,2);
0028    img_cols = max(levels(2,:));
0029    img_rows = max(levels(3,:));
0030 else
0031    ll = length( levels );
0032    img_cols = ceil( sqrt( ll ));
0033    img_rows = ceil( ll/ img_cols );
0034 end
0035    subplot(img_rows,img_cols,1);
0036 
0037 % Get geometry Fc
0038 fc = eidors_obj('get-cache', fwd_mdl, 'slicer_plot_fc');
0039 if ~isempty( fc )
0040     eidors_msg('image_levels: using cached value', 3);
0041 else
0042    [fc] = slicer_plot_n(levels(1),img_data,vtx,simp);
0043    eidors_obj('set-cache', fwd_mdl, 'slicer_plot_fc', fc);
0044    eidors_msg('image_levels: setting cached value', 3);
0045 end
0046 
0047 % Set mapped colours
0048 global eidors_colours;
0049 mpc= eidors_colours.mapped_colour;
0050 eidors_colours.mapped_colour = 128;
0051 
0052 for idx= 1:length(levels);
0053     subplot(img_rows,img_cols,idx);
0054     lev= levels(idx);
0055     slicer_plot_n(lev,img_data,vtx,simp, fc);
0056     view(2);
0057     axis('off');
0058     axis equal
0059     title(sprintf('z=%4.2f',lev));
0060 end
0061 
0062 % Reset mapped colours
0063 eidors_colours.mapped_colour = mpc;

Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005