BlackrockNeurotech / NPMK

Neural Processing Matlab Kit is a set of functions for loading and manipulating data from Blackrock Microsystems' data files (.CCF, .NEV, .NSx).
44 stars 57 forks source link

NEV MetaTags lists incorrect DataDuration and DataDurationSec value #46

Open jmw182 opened 1 year ago

jmw182 commented 1 year ago

I noticed that NEV files recorded from the Gemini system (using Central 7.6.0) do not show the correct duration in the MetaTags. This does not affect NS6 files.

Here is an example NEV.MetaTags structure for a 60 second recording, where DataDurationSec was reported as 6.3050e+04:

>> NEV.MetaTags

ans = 

  struct with fields:

            Subject: 'CRSXX'
       Experimenter: 'active_minute none'
           DateTime: '29-May-2023 15:34:01'
          SampleRes: 30000
            Comment: '                                                                                                                                                                                                                                                                '
         FileTypeID: 'BREVENTS'
              Flags: '0000000000000001'
         openNEVver: []
        DateTimeRaw: [2023 5 1 29 15 34 1 299]
           FileSpec: '3.0'
        PacketBytes: 108
       HeaderOffset: 24912
       DataDuration: 1.8915e+09
    DataDurationSec: 6.3050e+04
        PacketCount: 449548
            TimeRes: 1.0000e+09
        Application: 'File Dialog v7.6.0'
           Filename: '20230529-113401-001'
           FilePath: 'P:\data_raw\human\crs_array\CRSXX\BlackrockData\Baseline256\ActiveMinute\20230529-113401\20230529-113401-001.nev'
            FileExt: '.nev'
          ChannelID: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 … ]

The associated NS6 file correctly displays both DataDurationSec and DataPointsSec as 60.

This issue also affects data collected with the previous firmware version, before switching to PTP time (below is also a 60 second file with 30k time res)

>> NEV.MetaTags

ans = 

  struct with fields:

            Subject: [1×0 char]
       Experimenter: ' '
           DateTime: '28-Apr-2023 17:01:44'
          SampleRes: 30000
            Comment: '                                                                                                                                                                                                                                                                '
         FileTypeID: 'BREVENTS'
              Flags: '0000000000000001'
         openNEVver: []
        DateTimeRaw: [2023 4 5 28 17 1 44 768]
           FileSpec: '3.0'
        PacketBytes: 108
       HeaderOffset: 24912
       DataDuration: 33155881
    DataDurationSec: 1.1052e+03
        PacketCount: 697806
            TimeRes: 30000
        Application: 'File Dialog v7.5.2'
           Filename: '20230428-130144-001'
           FilePath: 'P:\data_raw\human\crs_array\CRSXX\BlackrockData\Baseline256\ActiveMinute\20230428-130144\20230428-130144-001.nev'
            FileExt: '.nev'
          ChannelID: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 … ]
GoktugAlkan commented 2 weeks ago

Hi, we also experienced a very similar problem with the Gemini system. Were you able to solve this issue? Below are the MetaTags of our nev-file whose data duration should normally not exceed 20 seconds:

NEV_gem_NSP.MetaTags

ans = 

  struct with fields:

            Subject: []
       Experimenter: []
           DateTime: '19-Jun-2024 08:39:17'
          SampleRes: 30000
            Comment: '                                                                                                                                                                                                                                                                '
         FileTypeID: 'BREVENTS'
              Flags: '0000000000000001'
         openNEVver: []
        DateTimeRaw: [2024 6 3 19 8 39 17 923]
           FileSpec: '3.0'
        PacketBytes: 108
       HeaderOffset: 1936
       DataDuration: 687014138
    DataDurationSec: 2.2900e+04
        PacketCount: 21
            TimeRes: 1.0000e+09
        Application: 'File Dialog v7.6.1'
           Filename: 'NSP-20240619-103917-001'
           FilePath: 'C:\Users\lab\Desktop\testing_new_system\recordings\ML\20240619-103917'
            FileExt: '.nev'
          ChannelID: [257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272]
jmw182 commented 2 weeks ago

@GoktugAlkan, not really a fix but it seems that the latest version of NPMK just removed these fields from the NEV output: https://github.com/BlackrockNeurotech/NPMK/pull/66

GoktugAlkan commented 2 weeks ago

Thanks! I will update the NPMK again