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.m 4831 2015-03-29 21:13:25Z bgrychtol-ipa $
0012 
0013 
0014 warning('EIDORS:deprecated','IMAGE_LEVELS is deprecated as of 29-Mar-2015. ');
0015 
0016 set(gcf,'NumberTitle','off');
0017 set(gcf,'Name', img.name);
0018 fwd_mdl= img.fwd_model;
0019 vtx=  fwd_mdl.nodes;
0020 simp= fwd_mdl.elems;
0021 img_data = img.elem_data;
0022 
0023 
0024 if size(levels,1)==3
0025    ll = size(levels,2);
0026    img_cols = max(levels(2,:));
0027    img_rows = max(levels(3,:));
0028 else
0029    ll = length( levels );
0030    img_cols = ceil( sqrt( ll ));
0031    img_rows = ceil( ll/ img_cols );
0032 end
0033    subplot(img_rows,img_cols,1);
0034 
0035 % Get geometry Fc
0036 fc = eidors_obj('get-cache', fwd_mdl, 'slicer_plot_fc');
0037 if ~isempty( fc )
0038     eidors_msg('image_levels: using cached value', 3);
0039 else
0040    [fc] = slicer_plot_n(levels(1),img_data,vtx,simp);
0041    eidors_obj('set-cache', fwd_mdl, 'slicer_plot_fc', fc);
0042    eidors_msg('image_levels: setting cached value', 3);
0043 end
0044 
0045 % Set mapped colours
0046 global eidors_colours;
0047 mpc= eidors_colours.mapped_colour;
0048 eidors_colours.mapped_colour = 128;
0049 
0050 for idx= 1:length(levels);
0051     subplot(img_rows,img_cols,idx);
0052     lev= levels(idx);
0053     slicer_plot_n(lev,img_data,vtx,simp, fc);
0054     view(2);
0055     axis('off');
0056 if ~exist('OCTAVE_VERSION'); % octave gives ft_render warnings
0057     axis equal
0058 end
0059     title(sprintf('z=%4.2f',lev));
0060 end
0061 
0062 % Reset mapped colours
0063 eidors_colours.mapped_colour = mpc;

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005