?? vmpreturnvec.m
字號:
function vmpVec = vmpReturnVec(path, vmp);
% syntax: vmpVec = returnVMPvec(path, vmp)
%
% this func returns the vmpMat of the map [path vmp '.vmp']
% in a vector form (which is vmpMat read in the order:
% for z=1:slices
% for y=1:rows
% for x=1:cols)
%
% This function was written by:
% Hagar Gelbard
% Rafi Malach's Lab
% Weizmann Institute of Science
% Rehovot, Israel
% hagar.gelbard@weizmann.ac.il
% open the vmp file for reading
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');
df1 = fread(fid,1,'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');
cols = (XEnd-XStart+1)/resolution;
rows = (YEnd-YStart+1)/resolution;
slices = (ZEnd-ZStart+1)/resolution;
voxelsNo = cols*rows*slices;
fseek(fid, 0, 'cof');
vmpVec=fread(fid, voxelsNo, 'float');
fclose('all');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -