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

📄 vtccreatevmpofaveragecorrtcs.m

📁 VTC file is the file format of the Brainvoyager. The FMRI matchine scan human s brain and get the vt
💻 M
字号:
function vmpVec = vtcCreateVMPOfAverageCorrTCs(path, vtc, vmp);
% syntax: vmpVec = vtcCreateVMPOfAverageTCs(path, vtc, vmp)
% 
% this func go over the voxels of the [path vtc '.vtc'] file
% for each voxel, it averages its TC and write 
% the result into vmpVec (the returned value)
% in the end it uses the writeVMP func to display the results as a map
% 
% This function was written by:
% Hagar Gelbard
% Rafi Malach's Lab
% Weizmann Institute of Science
% Rehovot, Israel
% hagar.gelbard@weizmann.ac.il

% datestr(now)

vtc_fid = fopen([path vtc '.vtc'],'r');

[NoOfVolumes, cols, rows, slices] = vtcMoveToAfterHeaderPosition(vtc_fid);

voxelsNo = rows * cols * slices;

for voxel = 1:voxelsNo
    TC = fread(vtc_fid, NoOfVolumes, 'uint16');
    TC = TC/10000-1;
			% calculate average variance (in time) for that voxel, and normalize it
            % in case of garbage data we put in the vtc constant time
            % course, so in the VMP mat we put there zero. (we use
            % 1 - normalized_variance for display purposes (in order to use the
            % correlation map format) so 0 infact stands for  maximal
            % variance.
	if (sum(abs(diff(TC)))==0)
        vmpVec(voxel)=0;
	else
        vmpVec(voxel) = mean(TC);
	end
end

writeVMP(path, vmp, vmpVec, 3, NoOfVolumes -1)

fclose('all');
% datestr(now)

⌨️ 快捷键说明

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