Error in convert raw to lfp

hi, everyone
I face a problem in converting raw to lfp with blackrock ns6 files.

Following is the error report.

Does anyone have idea about it?

@mpompolas @Sylvain?

Hello,
I updated the npmk package and I got the new error.

Following is the error report.
What do the left side and right side mean in this report ?

I am not familiar with these functions, but the authors are not available at the moment to work on their support.
I could try to help fixing this bug, but I would need some help from you to reproduce the error:

  • Please share a short example file that causes this issue (as small as possible): upload it somewhere and post the download link here
  • Post the step-by-step procedure for me to reproduce the error from the Brainstorm interface, starting from clicking on the menu "Review raw file"

Example of a recent debugging discussion regarding the same functions:

Hi Francois

While I tried to reproduce the error, I extract 3 sec recording data from my original 45 mins recording file and save as the blackrock ns6 file format.
Interestingly, this 3 sec version recording data didn't reproduce the error.
I can follow the steps in tutorial of Multiunit electrophysiology.
There is no error during "convert raw to lfp" step.
Then I tried to extract whole recording data expect for
I thought that the data extracting process makes the data length of every channel equal to each others but this extra extracting process is weird to me.
I import the original recording into matlab for checking the data length and the data length of every channel is same.
However, I can start analyze the LFP from blackrock system now.

Best,
CYChang

If you can reproduce the error with a relatively short file (not 20Gb), please share it here.
Fixing errors now might help other users in the future.

Original file (4.62GB) It will produce error.


The file extract by NPMK (4.63GB) This won't produce error.

I hope these files can help developer to fix the error.

Best

Thank you for the example file.
I could reproduce the error and start investigating the problem.

There are some things I don't understand with what the NPMK library returns: the length of the signals read from the file does not match the inputs given to the reading function..

Here is how to reproduce this weird behavior:

DataFile = 'C:\...\G38-1.ns6';
rec = openNSx(DataFile, 'noread', 'nozeropad');
nSamples = rec.MetaTags.DataPoints;    % 70943612

rec = openNSx('read', DataFile , 'channels', 1, 'sample', 't:1:70943612', 'p:short', 'uV');
nSamplesRead = size(rec.Data,2);  % 70943714

The first size is used to initialize a matrix: https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_convert_raw_to_lfp.m#L143

length(downsample(1:70943612, round(30000/1000)))   %  2364788

The second size is the dimension of the signals read from the .ns6 file, and downsampled for real: https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_convert_raw_to_lfp.m#L350

length(downsample(1:70943714, round(30000/1000)))  %  2364791

In these last two computations, you can recognize the dimensions mismatch that cause the error you reported:

I opened an issue on the NPMK github repository to understand this issue better:
https://github.com/BlackrockNeurotech/NPMK/issues/37

@mpompolas Any suggestion?

@cychang1taiwan @cychang
The developers of the NPMK library tried to download your file to explore the issue, but you deleted it from your Google Drive.
Could you please make this file available again, so that they can work on it?
Please post the new download link here, and if you have a github account, there:
https://github.com/BlackrockNeurotech/NPMK/issues/37#issuecomment-985783134

Thanks

@cychang1taiwan @cychang
Could you please make this file available again?
We can't any further with the debugging without sharing this files with Blackrock NPMK library developers.
Thanks