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

📄 analyzetype.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function [tmat, stype, bsize] = analyzetype(anatype)
% analyzetype  - return properties of analyze image datatype
%
% FORMAT:       [anadata, anareadtype, anareadsize] = analyzetype(anatype)
%
% Input fields:
%
%       anatype     numeric datatype given in Analyze header
%
% Output fields:
%
%       anadata     1x1 data field with correct type and zero content
%       anareadtype type string for fread operations
%       anareadsize number of bytes per pixel/voxel

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

% argument check
if nargin < 1 || ...
   ~isa(anatype, 'double') || ...
    length(anatype) ~= 1 || ...
    isnan(anatype) || ...
    isinf(anatype)
    error( ...
        'BVQXtools:BadArgument', ...
        'Invalid argument for call to %s.', ...
        mfilename ...
    );
end

% double check
while anatype > 256
    anatype = fix(anatype / 256);
end
switch anatype
    case {2},   bsize = 1; tmat = uint8(0);  stype = 'uint8=>uint8';
    case {4},   bsize = 2; tmat = int16(0);  stype = 'int16=>int16';
    case {8},   bsize = 4; tmat = int32(0);  stype = 'int32=>int32';
    case {16},  bsize = 4; tmat = single(0); stype = 'single=>single';
    case {64},  bsize = 8; tmat = 0;         stype = 'double=>double';
    case {130}, bsize = 1; tmat = int8(0);   stype = 'int8=>int8';
    case {132}, bsize = 2; tmat = uint16(0); stype = 'uint16=>uint16';
    case {136}, bsize = 4; tmat = uint32(0); stype = 'uint32=>uint32';
    otherwise
        error( ...
            'BVQXtools:BadArgument', ...
            'Invalid anatype value: %d.', ...
            anatype ...
        );
end

⌨️ 快捷键说明

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