0001 function fiff_write_dig_point(fid,dig)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 me='MNE:fiff_write_dig_point';
0030
0031 if nargin ~= 2
0032 error(me,'Incorrect number of arguments');
0033 end
0034
0035 FIFF_DIG_POINT=213;
0036 FIFFT_DIG_POINT_STRUCT=33;
0037 FIFFV_NEXT_SEQ=0;
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 datasize=5*4;
0048 count = fwrite(fid,int32(FIFF_DIG_POINT),'int32');
0049 if count ~= 1
0050 error(me,'write failed');
0051 end
0052 count = fwrite(fid,int32(FIFFT_DIG_POINT_STRUCT),'int32');
0053 if count ~= 1
0054 error(me,'write failed');
0055 end
0056 count = fwrite(fid,int32(datasize),'int32');
0057 if count ~= 1
0058 error(me,'write failed');
0059 end
0060 count = fwrite(fid,int32(FIFFV_NEXT_SEQ),'int32');
0061 if count ~= 1
0062 error(me,'write failed');
0063 end
0064
0065
0066
0067 count = fwrite(fid,int32(dig.kind),'int32');
0068 if count ~= 1
0069 error(me,'write failed');
0070 end
0071 count = fwrite(fid,int32(dig.ident),'int32');
0072 if count ~= 1
0073 error(me,'write failed');
0074 end
0075 count = fwrite(fid,single(dig.r(1:3)),'single');
0076 if count ~= 3
0077 error(me,'write failed');
0078 end
0079
0080 return;
0081
0082