Wiki

Clone wiki

ieeg / mefvalidate

MEF Validate

mefvalidate is a program that checks for issues with mef files. It exits with a system status of 0 if all tests pass, with a status of 1 if any passes fail in the last validation, and with 2 if an error occurs in the process.

mefvalidate checks for five properties that should exist in a valid MEF. That the maximum and minimum data values are present in the header of the file, that the start time in the header for the first sample matches the start time in the header of the first block and the start time in the indices, that the average number of samples in the MEF is above 2500 per block, and that the first 100 (or less in some cases) blocks do not have any time overlap. For the sampling average, the file can be read with less than 2500 samples per block, but it is very strongly recommended to keep the average sampling above 2500 per block.

Example usage:

mefvalidate left1.mef left2.mef
Starting validation on left1.mef...
Report:
[FAIL] [StartTimesMatch] header start time matches first index start time and first entry's start time: hst: 3535 ist: 3535 est: 3535
[FAIL] [CorrectBlockSize]less than 2500 samples in each block: (number_of_samples = 21000 / number_of_index_entries = 10) >= 2500: found 2100
[PASS] [MaxValuePresent] maximum_data_value present: value [3362]
[PASS] [MinValuePresent] minimum_data_value present: value [-252]
[FAIL] [NoBlockOverlap] first 100 block times overlap. Found 23 overlapping blocks, min overlap [23usecs] max overlap of [25252usecs].
Completed validation of left1.mef

Starting validation on left1.mef...
Report:
[PASS] [MaxValuePresent] maximum_data_value present: value [525]
[FAIL] [MinValuePresent] minimum_data_value not present: value [0]
[FAIL] [StartTimesMatch] header start time does not match first index start time and first entry's start time: hst: 3530 ist: 3532 est: 3535;
[PASS] [CorrectBlockSize] average of at least 2500 samples in each block: (number_of_samples = 34000 / number_of_index_entries = 10) >= 2500: found 3400
[PASS] [NoBlockOverlap] first 100 block times do not overlap.
Completed validation of left2.mef

Explanation:

  • MaxValuePresent: This test determines if the maximum data value of the MEF is included in the header. This simplifies the conversion to EDF process.

  • MinValuePresent: This test determines if the minimum data value of the MEF is included in the header. This simplifies the conversion to EDF process.

  • StartTimesMatch: This test determines if the start time in the header of the first block matches the start time listed in the MEF header and the MEF index. If the start times do not match, the portal will be unable to view the file.

  • CorrectBlockSize: This test determines if the average block size exceeds the minimum threshold of 2500 samples per block. Average block size at 2500 will ensure good compression.

  • NoBlockOverlap: This test determines if blocks overlap. In the case of overlap, the portal will be unable to view the file.

Updated