0001 function status = view_interp(color_map,clims,contour_array,contour_array2,title_text,image_labels,export_matrix,nrow,ncolumn,plot_res)
0002
0003
0004
0005
0006
0007
0008
0009
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 if nargin == 3
0046 contour(export_matrix,contour_array,'k-')
0047 else
0048 contour(export_matrix,contour_array,'k-');
0049 contour(export_matrix,contour_array2,'k--');
0050 end;
0051 axis('off')
0052 if nargin >= 5
0053 title(title_text);
0054 end;
0055 if nargin >= 6
0056 if size(image_labels,1) == nrow*ncolumn/plot_res/plot_res
0057 icount = 1;
0058 nrow = nrow/plot_res;
0059 ncolumn = ncolumn/plot_res;
0060 for j = nrow:-1:1
0061 for i = 1:ncolumn
0062 text((i-1)*plot_res+fix(plot_res/3),nrow*plot_res-3 -(j-1)*plot_res,image_labels(icount,:))
0063 icount = icount + 1;
0064 end
0065 end
0066 else
0067 disp('WARNING:improper number of labels')
0068 disp('WARNING:improper number of labels')
0069
0070 end
0071 end
0072
0073 status = 1;
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085