loadtacts.m

来自「医学图像处理matlab工具箱」· M 代码 · 共 35 行

M
35
字号
function actdata = loadtacts(actfile)
% function actdata = loadtacts(actfile)
%
% Reading IDA format act file.
% The actdata is a structure containing the 
% TACT names and curves in the following manner:
%
%   ith curve name    actdata(i).name
%   ith curve         actdata(i).tact
%   The i = 1 case contain the time scale.

fid = fopen(actfile);
fscanf( fid, '%s%',1);fscanf( fid, '%s%',1);%ignoring the first 2 line
num_of_tact = fscanf( fid, '%2d',1);
num_of_point = fscanf( fid, '%2d',1);
%
%reading  the time scale
%
actdata(1).name='tissue_ts';
actdata(1).tact = fscanf( fid, '%f',[num_of_point 1]);%reading the time scale
%
%reading the tact curves
%
for j=1:num_of_tact
    actdata(j+1).name = fscanf( fid, '%s%',1);
    fscanf( fid, '%s%',1);%ignoring the slice ident. numbers(eg.:101)
    for i=1:num_of_point
        tmptact(i) = fscanf( fid, '%f',1);
        fscanf( fid, '%f',1);%ignoring the STDEV values
    end
    actdata(j+1).tact =tmptact'; 
end
fclose(fid);

⌨️ 快捷键说明

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