⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newnatresvmp.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function vmp = newnatresvmp(bbox, res, mtype)
% newnatresvmp  - create natural resolution VMP object
%
% FORMAT:       vmp = newnatresvmp([bbox, res [, mtype]])
%
% Input fields:
%
%       bbox        bounding box (from BoundingBox)
%       res         resolution (from BoundingBox)
%       mtype       if given 1xN numeric map type (default [1])
%
% Output fields
%
%       vmp         NR-VMP object with requested properties

% Version:  v0.7b
% Build:    7083022
% Date:     Aug-30 2007, 10:47 PM CEST
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin < 1 || ...
   ~isa(bbox, 'double') || ...
    ndims(bbox) > 2 || ...
    any(size(bbox) ~= [2, 3]) || ...
    any(bbox(:) < 0 | bbox(:) > 255 | isnan(bbox(:))) || ...
    any(bbox(1, :) >= bbox(2, :))
    bbox = [57, 52, 59; 231, 172, 197];
end
if nargin < 2 || ...
   ~isa(res, 'double') || ...
    numel(res) ~= 1 || ...
   ~any((1:12) == res)
    res = 3;
end
if nargin < 3 || ...
   ~isa(mtype, 'double') || ...
    isempty(mtype) || ...
    any(isinf(mtype(:)) | isnan(mtype(:)) | mtype(:) < 0 | mtype(:) ~= fix(mtype(:)))
    mtype = 1;
else
    mtype = mtype(:);
end
if res > 1
    bbox(2, :) = bbox(2, :) + 1;
end
vsz = round(diff(bbox) ./ res);
if res > 1
    bbox(2, :) = bbox(1, :) + res * vsz;
end
if any(vsz == 0)
    error( ...
        'BVQXtools:BadArgument', ...
        'Bad or missing argument.' ...
    );
end

% create object
vmp = BVQXfile('new:vmp');
vmpu = BVQXfile(0, 'updatestate', 'vmp');
BVQXfile(0, 'updatedisable', 'vmp');
vmp.XStart = bbox(1, 1);
vmp.XEnd = bbox(2, 1);
vmp.YStart = bbox(1, 2);
vmp.YEnd = bbox(2, 2);
vmp.ZStart = bbox(1, 3);
vmp.ZEnd = bbox(2, 3);
vmp.Resolution = res;
vmp.Map(1).VMPData = single(zeros(diff(bbox) ./ res));
ofv = vmp.FileVersion;
if res > 1
    vmp.NativeResolutionFile = 1;
    vmp.FileVersion = 5;
else
    vmp.NativeResolutionFile = 0;
    vmp.FileVersion = 3;
end
vmp.Update('FileVersion', struct('type', '.', 'subs', 'FileVersion'), ofv);
vmp.Map.VMPData = single(zeros(vsz));
vmp.Map.Type = 1;
vmp.Map.DF2 = 0;
vmp.Map.BonferroniValue = prod(vsz);
vmp.Map.Name = '';
vmp.Map(2:numel(mtype)) = vmp.Map(1);
vmp.NrOfMaps = numel(vmp.Map);

% set type(s)
for mc = 1:numel(mtype)
    vmp.Map(mc).Type = mtype(mc);
end

% make setting as before
BVQXfile(0, 'updatestate', 'vmp', vmpu);
bless(vmp, 1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -