📄 load_image.m
字号:
function load_image(filename, type)%LOAD_IMAGE Load an image file with a specified format%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu, mark@alice.uoregon.edu%global I H Fname FullFname readpathif nargin==1 type=getparameter(H, 'File Type'); if type == inf type='NANO3'; endendif isempty(filename) if strcmp(upper(type), 'NANO3') | strcmp(upper(type), 'NANO2') ext='*'; elseif strcmp(upper(type), 'SPIDER') ext='*.DAT'; else ext=['*.' lower(type(1:3))]; end [name, path]=uigetfile([readpath ext]); if isempty(name) | name == 0 return; end Fname1= name; FullFname1 = [path name];else if isempty(find(filename=='/')) path=readpath; Fname1=filename; FullFname1=[path Fname1]; else FullFname1=filename; Fname1=FullFname1(1+max(find(FullFname1=='/')):length(FullFname1)); endendif ~closeimage return;endFname=Fname1;FullFname=FullFname1;f=watchon;statusbar(['Loading image from: ' FullFname]);if strcmp(upper(type), 'NANO3') [I,H, errmsg]=nano3read(FullFname);elseif strcmp(upper(type), 'NANO2') [I,H, errmsg]=nano2read(FullFname);elseif strcmp(upper(type), 'MATLAB') [I,H, errmsg]=readMATLAB(FullFname);elseif strcmp(upper(type), 'TIFF') [I,H, errmsg]=readTIFF(FullFname);elseif strcmp(upper(type), 'BMP') [I,H, errmsg]=readBMP(FullFname);elseif strcmp(upper(type), 'GIF') [I,H, errmsg]=readGIF(FullFname);elseif strcmp(upper(type), 'PCX') [I,H, errmsg]=readPCX(FullFname);elseif strcmp(upper(type), 'SPIDER') [I,H, errmsg]=readSPIDER(FullFname);endif isempty(errmsg) & ~isempty(I) createimgax; setimage(ind2height(H,I),[1 1], 0); imagetitle; imagenote; setalexmenu('on'); clearstatusbar; watchoff(f);else clearstatusbar; watchoff(f); alexerror([FullFname '|' errmsg]);endreturn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -