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

📄 vmpreplaceheaderparameter.m

📁 vmp is the file generate from Brainvoyager which can link vtc file and the 3D image. This toolbox he
💻 M
字号:
function returnVal = vmpReplaceHeaderParameter(drive, vmp, newVal);

% syntax : vmpChangeHeaderParameter(drive, vmp, newVal)
% the function replace a header parameter with newVal.
% it is now written for the df1 parameter, but this can easily be changed.
% 
% This function was written by:
% Hagar Gelbard
% Rafi Malach's Lab
% Weizmann Institute of Science
% Rehovot, Israel
% hagar.gelbard@weizmann.ac.il

path = [drive ':\Hagar\Data\'];

% open the file for reading and writing
fid = fopen([path vmp '.vmp'],'r+');

% READ HEADER

ver = fread(fid,1,'short');
NrOfMaps = fread(fid,1,'short');
MapType = fread(fid,1,'short');
NrOfLags = fread(fid,1,'short');
ClusterSize = fread(fid,1,'short');
CritThreshold = fread(fid,1,'float');
MaxThreshold = fread(fid,1,'float');

% -----------------------------------------------------------------------
% use the following code to replace a variable
% -----------------------------------------------------------------------
tmp=ftell(fid);
df1 = fread(fid,1,'short');
fseek(fid,tmp,'bof');
fwrite(fid, newVal, 'short');

df2 = fread(fid,1,'short');
MapName = [];
a = 'a';
while a ~= 0
  a = fread(fid,1,'char');
  MapName = [MapName a];
end
char(MapName);
DimX = fread(fid,1,'short');
DimY = fread(fid,1,'short');
DimZ = 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');
resolution = fread(fid,1,'short');

fclose('all');

⌨️ 快捷键说明

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