📄 bvqxtools_path.m
字号:
function p = bvqxtools_path(p)
% bvqxtools_path - get path where BVQXtools is installed
%
% FORMAT: p = bvqxtools_path([p])
%
% Input fields:
%
% p optional path, either of
% - base (default)
% - bin
% - contrib
% - files (outside of BVQXtools)
% - lut
% - tfg
%
% Output fields:
%
% p path with forward slashes for BVQXfile (or other)
% Version: v0.7b
% Build: 7092813
% Date: Sep-28 2007, 1:02 PM CEST
% Author: Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools
% persistent memory
persistent bvqx_p;
if numel(bvqx_p) ~= 1 || ...
~isstruct(bvqx_p)
% create struct
bvqx_p = struct;
% get path
px = strrep(fileparts(mfilename('fullpath')), '\', '/');
if px(end) == '/'
px(end) = [];
end
% put path in base field
bvqx_p.base = px;
% get files folder
[p1, p2] = fileparts(px);
p2 = regexprep(p2, '^(.*_v\d+[a-z]*).*$', '$1_files');
bvqx_p.files = [p1 '/' p2];
end
% argument check
if nargin < 1 || ...
~ischar(p)
p = 'base';
else
p = lower(p(:)');
end
% what path
switch(p)
case {'bin'}
p = [bvqx_p.files '/bin'];
if ispc
p = strrep([p '/windows'], '/', '\');
elseif ~strcmpi(computer, 'mac')
p = [p '/linux'];
else
p = [p '/mac'];
end
case {'colin'}
p = [bvqx_p.files '/colin'];
case {'contrib'}
p = [bvqx_p.files '/contrib'];
case {'dicom'}
p = [bvqx_p.files '/dicom'];
case {'files'}
p = bvqx_p.files;
case {'ihc'}
p = [bvqx_p.files '/ihc'];
case {'lut'}
p = [bvqx_p.files '/lut'];
case {'srf'}
p = [bvqx_p.files '/srf'];
case {'tal'}
p = [bvqx_p.files '/tal'];
case {'tfg'}
p = [bvqx_p.files '/tfg'];
otherwise
p = bvqx_p.base;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -