addpath(genpath(’.’))
简单的说就是将指定文件夹添加到当前 MATLAB会话的搜索路径的顶层;
可一次性添加多个目录路径(功能和图形界面中的’设置路径’一致);
在 addpath 内调用 genpath,则将该文件夹下的所有子文件夹添加到搜索路径中;
一般安装后默认的搜索路径如下图:
该链接可指向更多关于搜索路径的内容
MathWorks Documentation —addpath
MATLAB Function Reference — addpath
isstruct
size(I,3)
I = double(mha_read_volume(sprintf('%s/VESSEL12_%s.mhd',params.scansdir,temp_str)));
for i = 1:size(I,3)
I(:,:,i) = map_image_to_256((I(:,:,i)+1024));
end
%%%%% map_image_to_256.m %%%%% file content:
function I = map_image_to_256(I)
temp_idx = find(I ~= 0);
if (~isempty(temp_idx))
LOW = min(I