Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions external/mne/fiff_read_meas_info.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
% License : BSD 3-clause
%
%
% Revision 1.15 2025/06/30 10:10:30
% Improved to handle string type digitization, especially in the new FIFF
% data by MEGIN
%
% Revision 1.14 2009/03/31 01:12:30 msh
% Improved ID handling
%
Expand Down Expand Up @@ -214,6 +218,22 @@
p = p + 1;
tag = fiff_read_tag(fid,pos);
dig(p) = tag.data;
elseif kind == FIFF.FIFF_DIG_STRING % added to address updated FIFF format (2024-25)
tag = fiff_read_tag(fid,pos);
if length(tag.data.r)>3
assert(mod(length(tag.data.r), 3) == 0,...
'length of vector tag.data.r must be 3*(no. of points in a string)')
rr = reshape(tag.data.r, 3, []);
for pp = 1:(length(tag.data.r)/3)
p = p + 1;
tag_data_pp = tag.data;
tag_data_pp.r = rr(:,pp);
dig(p) = tag_data_pp;
end
else
p = p + 1;
dig(p) = tag.data;
end
else
if kind == FIFF.FIFF_MNE_COORD_FRAME
tag = fiff_read_tag(fid,pos);
Expand Down
10 changes: 10 additions & 0 deletions external/mne/fiff_read_tag.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
% License : BSD 3-clause
%
%
% Revision 1.17 2025/06/30 10:10:30
% Added to read string type digitization, especially in the new FIFF
% data by MEGIN
%
% Revision 1.16 2008/11/17 15:07:00 msh
% Added reading of short, unsigned short, and unsigned int data
%
Expand Down Expand Up @@ -278,6 +282,12 @@
tag.data.ident = fread(fid,1,'int32=>int32');
tag.data.r = fread(fid,3,'single=>single');
tag.data.coord_frame = 0;
case FIFF.FIFFT_DIG_STRING_STRUCT
tag.data.kind = fread(fid,1,'int32=>int32');
tag.data.ident = fread(fid,1,'int32=>int32');
npts = fread(fid,1,'int32=>int32');
tag.data.r = fread(fid,npts*3,'single=>single');
tag.data.coord_frame = 0;
case FIFF.FIFFT_COORD_TRANS_STRUCT
tag.data.from = fread(fid,1,'int32=>int32');
tag.data.to = fread(fid,1,'int32=>int32');
Expand Down