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

📄 dispslicemovie.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function dispslicemovie(voldata, dir)
% dispslicemovie  - display slice movie
%
% FORMAT:       dispslicemovie(voldata, dir)
%
% Input fields:
%
%       voldata     3-D dataset
%       dir         either of [-3, -2, -1, 1, 2, 3]
%
% See also dispslice

% Version:  v0.6a
% Build:    6121315
% Date:     Dec-13 2006, 3:45 PM CET
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin < 2 || ...
    isempty(voldata) || ...
    length(size(voldata)) ~= 3 || ...
    isempty(dir)
    error( ...
        'BVQXtools:BadArgument', ...
        'Bad or missing input argument provided.' ...
    );
end

% get size and necessary values
vsz = size(voldata);
vmn = double(min(voldata(:)));
vmx = double(max(voldata(:)));

% delete dispslice figure
dispslice closefig;

% slice preselection is empty
slc = [];

% more than single direction given
if numel(dir) > 1
    slc = dir(2:end);
    dir = dir(1);
end

% reject invalid dir's
if ~any([-3, -2, -1, 1, 2, 3] == dir)
    error( ...
        'BVQXtools:BadArgument', ...
        'Invalid dir argument.' ...
    );
end

% if negative go backwards
reversed = false;
if dir < 0
    dir = -dir;
    reversed = true;
end

% force good slices
slc = intersect(slc, 1:vsz(dir));

% preselection empty ?
if isempty(slc)

    % all slices
    slc = 1:vsz(dir);
end

% reversed
if reversed
    slc = slc(end:-1:1);
end

% get slice size
switch (dir)
    case {1}
        ssz = vsz(2:3);
    case {2}
        ssz = vsz([1, 3]);
    otherwise
        ssz = vsz(1:2);
end
ssx = vsz(dir);

% create empty dispslice
dispslice(zeros(ssz));

% get image handle
ih = dispslice('image');

% display requested slices
for sl = slc
    switch (dir)
        case {1}
            dispslice(voldata(sl, :, :), ih, [vmn, vmx]);
        case {2}
            dispslice(voldata(:, sl, :), ih, [vmn, vmx]);
        otherwise
            dispslice(voldata(:, :, sl), ih, [vmn, vmx]);
    end
    dispslice(sprintf('Dispslicemovie: slice %d/%d', sl, ssx));
    pause(0.04);
end

⌨️ 快捷键说明

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