Home > eeg > egis > scripts > view_interp.m

view_interp

PURPOSE ^

status = view_interp(color_map,clims,contour_array,contour_array2,image_labelsimage_name,nrow,ncolumn,plot_res)

SYNOPSIS ^

function status = view_interp(color_map,clims,contour_array,contour_array2,title_text,image_labels,export_matrix,nrow,ncolumn,plot_res)

DESCRIPTION ^

status = view_interp(color_map,clims,contour_array,contour_array2,image_labelsimage_name,nrow,ncolumn,plot_res)

view interpolation binary with header

color_map = what it says
clims = colormap limits (optional)
contour_array = first contour array (gets a solid blue contour line) 
contour_array2 = second contour array (gets a dashed red line).

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function status = view_interp(color_map,clims,contour_array,contour_array2,title_text,image_labels,export_matrix,nrow,ncolumn,plot_res)
0002 %status = view_interp(color_map,clims,contour_array,contour_array2,image_labelsimage_name,nrow,ncolumn,plot_res)
0003 %
0004 %view interpolation binary with header
0005 %
0006 %color_map = what it says
0007 %clims = colormap limits (optional)
0008 %contour_array = first contour array (gets a solid blue contour line)
0009 %contour_array2 = second contour array (gets a dashed red line).
0010 figure
0011 if nargin < 7
0012 [fname,pathname] = uigetfile('*.img','Select image file:');
0013 fid = fopen([pathname fname],'rb');
0014 nrow = fread(fid,1,'float');
0015 ncolumn = fread(fid,1,'float');
0016 plot_res = fread(fid,1,'float');
0017 export_matrix = fread(fid,[ncolumn,nrow],'float');
0018 export_matrix = export_matrix';
0019 fclose(fid);
0020 end
0021 export_matrix(find(export_matrix == -100)) = -0.1*clims(2)*ones(size(find(export_matrix == -100),1),size(find(export_matrix == -100),2))
0022 if nargin == 1
0023 clims(2) = 0.75*max(max(export_matrix));
0024 clims(1) = 1.25*min(min(export_matrix));
0025 end;
0026 if isempty(clims)
0027 clims(2) = 0.6*max(max(export_matrix));
0028 clims(1) = 1.4*min(min(export_matrix));
0029 end;
0030 clims(1) =-0.1*clims(2);
0031 color_map2 = [1 1 1; color_map];
0032 imagesc(export_matrix,clims), colorbar, colormap(color_map2), shading interp
0033 mean_mat = max(max(export_matrix))/4;
0034 steps = 0.1;
0035 max(max(export_matrix))
0036 hold on
0037 if (nargin ==2|nargin == 1)
0038 contour_array2 = [min(min(export_matrix))+step:steps:(mean_mat-steps)];
0039 contour_array = [mean_mat:steps:max(max(export_matrix))];
0040 end;
0041 if isempty(contour_array)
0042 contour_array2 = [(mean_mat-7*steps):steps:(mean_mat-steps)];
0043 contour_array = [mean_mat:steps:max(max(export_matrix))];
0044 end;
0045 
0046 if nargin == 3
0047 contour(export_matrix,contour_array,'k-')
0048 else
0049 contour(export_matrix,contour_array,'k-');
0050 contour(export_matrix,contour_array2,'k--');
0051 end;
0052 axis('off')
0053 if nargin >= 5
0054     title(title_text);
0055 end;
0056 if nargin >= 6
0057     if size(image_labels,1) == nrow*ncolumn/plot_res/plot_res
0058         icount = 1;
0059         nrow = nrow/plot_res;
0060         ncolumn = ncolumn/plot_res;
0061         for j = nrow:-1:1
0062             for i = 1:ncolumn
0063                 text((i-1)*plot_res+fix(plot_res/3),nrow*plot_res-3 -(j-1)*plot_res,image_labels(icount,:))
0064                 icount = icount + 1;
0065             end
0066         end
0067     else
0068         disp('WARNING:improper number of labels')
0069         disp('WARNING:improper number of labels')
0070 
0071     end
0072 end
0073 
0074 status = 1;
0075 
0076 
0077 
0078 
0079 
0080 
0081 
0082 
0083 
0084 
0085 
0086

Generated on Wed 20-Mar-2019 04:00:51 by m2html © 2003