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

📄 vtcmovetoafterheaderposition.m

📁 VTC file is the file format of the Brainvoyager. The FMRI matchine scan human s brain and get the vt
💻 M
字号:
function [NoOfVolumes, cols, rows, slices, protocol, TR] = vtcMoveToAfterHeaderPosition(fid);
% This function was written by:
% Hagar Gelbard
% Rafi Malach's Lab
% Weizmann Institute of Sceince
% Rehovot, Israel
% hagar.gelbard@weizmann.ac.il
% 
% syntax: [NoOfVolumes, cols, rows, slices, protocol, TR] = vtcMoveToAfterHeaderPosition(fid);
% 
% this func moves the given vtc fid to the after header position
% (i.e., where the data starts)
% it returns NoOfVolumes, cols, rows & slices, which are frequently used
% parameters
% 
% This function was written by:
% Hagar Gelbard
% Rafi Malach's Lab
% Weizmann Institute of Science
% Rehovot, Israel
% hagar.gelbard@weizmann.ac.il

% READ HEADER

% read version number
ver = fread(fid,1,'short');
	
% read fmr name
fmr = [];
a = 'a';
while a ~= 0
  a = fread(fid,1,'char');
  fmr = [fmr a];
end

% read protocol name
protocol = [];
a = 'a';
while a ~= 0
  a = fread(fid,1,'char');
  protocol = [protocol a];
end

% read important parameters
NoOfVolumes = fread(fid,1,'short');
VTC_resolution  = fread(fid,1,'short');
XStart = fread(fid,1,'short');
XEnd = fread(fid,1,'short');
YStart = fread(fid,1,'short');
YEnd = fread(fid,1,'short');
ZStart = fread(fid,1,'short');
ZEnd = fread(fid,1,'short');
HemDelay = fread(fid,1,'short');
TR = fread(fid,1,'float');
HemDelta = fread(fid,1,'float');
HemTau = fread(fid,1,'float');
SegmentSize = fread(fid,1,'short');
SegmentOffset = fread(fid,1,'short');

% end of header

cols = (XEnd-XStart)/VTC_resolution;
rows = (YEnd-YStart)/VTC_resolution;
slices = (ZEnd-ZStart)/VTC_resolution;

⌨️ 快捷键说明

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