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

📄 voi_bvcoords.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function bvc = voi_BVCoords(hfile, voi)
% VOI::BV1Coords  - return BV system coords for a voi
%
% FORMAT:       bvc = voi.BVCoords(voi)
%
% Input fields:
%
%       voi         number of name of VOI
%
% Output fields:
%
%       bvc         Nx3 coords (e.g. to index into 256^3 VMR space)

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

% argument check
if nargin < 2 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, 'voi') || ...
   (~ischar(voi) && ~isa(voi, 'double')) || ...
    isempty(voi)
    error( ...
        'BVQXfile:BadArguments', ...
        'Invalid call to %s.', ...
        mfilename ...
    );
end
bc = bvqxfile_getcont(hfile.L);
numvois = numel(bc.VOI);
if ischar(voi)
    voiok = false;
    for vc = numvois
        if ~isempty(regexpi(bc.VOI(vc).Name, lower(voi(:)')))
            voiok = true;
            brea;
        end
    end
    if ~voiok
        error( ...
            'BVQXfile:InvalidName', ...
            'Named VOI not found.' ...
        );
    end
    voi = vc;
else
    voi = real(voi(:)');
    if any(isinf(voi) | isnan(voi) | voi < 1 | voi > numvois) || ...
        numel(unique(fix(voi))) ~= numel(voi)
        error( ...
            'BVQXfile:BadArgument', ...
            'Invalid VOI selection.' ...
        );
    end
    voi = fix(voi);
end

% get voi
voi = bc.VOI(voi);

% initialize bvc
bvc = voi.Voxels;

% transform?
if strcmpi(bc.CoordsType, 'tal')
    bvc = tal2bv(bvc')';
end

⌨️ 快捷键说明

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