[FieldTrip] ft_write_data not writing all the data to the edf file

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Mon Oct 19 12:25:32 CEST 2020


Dear Akshi,

It is impossible to tell what is going on without any additional diagnostic information. I suggest that you first inspect the variables yourself after each of the consecutive calls to gain some insight. For instance, what are the contents of filehdr?

Then, you might want to read the code that is doing the writing of the data to edf format. It might be that the low-level code does not accept any ‘random’ number of samples to be written, but it tries to force the file into a format with fixed block sizes or so, which could cause the rounding off of the number of samples.

Once you have found the cause of the problem, you can start working towards a solution. I would think that this requires (if a solution exists) that some low level code might be adjusted a bit.

We are looking forward to your contributions as a pull request on github.

Finally, it is not clear to me  why you’d want the data to be written in the edf format, but I would be extremely cautious, and check whether the necessary details are saved along with the data (i.e. metadata pertaining to channel names, but more importantly the timing information of the individual samples).

Best wishes,

Jan-Mathijs



On 15 Oct 2020, at 20:16, IMT2016025 Akshi <Akshi.025 at iiitb.org<mailto:Akshi.025 at iiitb.org>> wrote:

Dear community,

I am trying to save epoched data that is stored in .mat file as .edf using ft_write_data. For example, one of my .mat files has 1713 trials with 651 datapoints in each trial amounting to 1713 * 651 = 1115163 columns in total. I use the following code to concatenate data of these trials and save it as .edf file.

mat_data = load(mat_file_name);
filehdr = ft_fetch_header(mat_data.data);
concat_data = cat(2,mat_data.data.trial{:});
ft_write_data(edf_file_name , concat_data, 'header', filehdr);

I get a .edf file which has only 1115000 columns. Similarly, in another case, original file has 1257081 columns but the generated .edf file has only 1257000 columns.

Could anyone please tell what could be causing this to happen?

Thanks and regards,
Akshi
IIIT-Bangalore, India
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201019/8c8d4ff8/attachment.htm>


More information about the fieldtrip mailing list