diff --git a/zUtil_EDF/edf_write.m b/zUtil_EDF/edf_write.m index d263efa430ac16ef4ba1358de8f294dc156fd820..732a03bf2c792ba8ce3b0c259f87993ff8965519 100644 --- a/zUtil_EDF/edf_write.m +++ b/zUtil_EDF/edf_write.m @@ -5,6 +5,10 @@ function edf_write(data, filename, info, minimal) % % WARNING! THESE IMAGES DO NOT NEED TRANSPOSING BEFORE WRITING! % +% Any data dimension provided in the fields 'dim_1','dim_2','dim_3' of +% the header 'info' will be overwritten by the actual data sizes. +% +% % INPUT: % data = <anytype> Image data to write in the EDF file. The datatype % of the EDF file will be the same as the Matlab @@ -64,10 +68,7 @@ function edf_write(data, filename, info, minimal) error('EDF:bad_data_format', 'Unsupported "%s" datatype', class(data)); end end - - if any(isfield(edfinfo,{'dim_1', 'dim_2', 'dim_3'})) - disp('Overwriting dimensions found in info structure with those from data') - end + [edfinfo.dim_2, edfinfo.dim_1, edfinfo.dim_3] = size(data); edfinfo.size = edfinfo.dim_2 * edfinfo.dim_1 * edfinfo.dim_3;