Skip to content

Commit

Permalink
Make saturation flags SNIRF spec compliant (#42)
Browse files Browse the repository at this point in the history
* SNIRF spec compliance on aux data types (floating)
* Update version
  • Loading branch information
samuelpowell authored Nov 16, 2022
1 parent 7a9aecc commit 81c6bd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions +lumofile/write_SNIRF.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

% Write format version
%
snirf.formatVersion = write_var_string(fid, '/formatVersion', '1.0');
snirf.formatVersion = write_var_string(fid, '/formatVersion', '1.1');

% Over each group
%
Expand Down Expand Up @@ -294,8 +294,7 @@
nirs_aux_sat = create_group(nirs_group, ['aux' num2str(auxi)]);
snirf.nirs(gidx).aux(auxi).name = write_var_string(nirs_aux_sat, 'name', 'saturationFlags');
snirf.nirs(gidx).aux(auxi).time = write_double(nirs_aux_sat, 'time', [0 data(gidx).chn_dt]);
snirf.nirs(gidx).aux(auxi).dataTimeSeries = write_int32_compressed(nirs_aux_sat, 'dataTimeSeries', data(gidx).chn_sat.');

snirf.nirs(gidx).aux(auxi).dataTimeSeries = write_single_compressed(nirs_aux_sat, 'dataTimeSeries', data(gidx).chn_sat.');
H5G.close(nirs_aux_sat);
auxi = auxi+1;
end
Expand Down Expand Up @@ -629,6 +628,11 @@
write_core(base, path, single(val), tp, false, false);
end

function val = write_single_compressed(base, path, val)
tp = H5T.copy('H5T_IEEE_F32LE');
write_core(base, path, single(val), tp, false, true);
end

function write_core(base, path, val, tp, fix_shape, compress)

% Dataspace
Expand Down
2 changes: 1 addition & 1 deletion +lumomat/ver.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [ver] = ver()
%LMVER Return the hard coded version of the package
ver = '1.5.0-dev';
ver = '1.5.0';
end

0 comments on commit 81c6bd2

Please sign in to comment.