The repository implements the following package:
package br.unb.biologiaanimal.edf;
which provides an interface with EDF files for the Java programming language, so we can use them in our MATLAB applications. The produced Jar file enables the deconstruction of an EDF file into its header and its records; so the raw records can be directly accessed or translated to ASCII friendly formats.
Although it is already being used, this code is work in progress and shall be used carefully.
Help and ideas are always welcome! :)
To build this package, run
make
It will generate an edf.jar
file on the target
folder. This Jarfile can be included in your application wherever needed.
The current workings of JEDF are destined to a v0.4
, which must enable the programmer to convert the EDF both to CSV and back to the EDF format, so they can make changes on the EDF file and save it back to later concerns.
Future ideas include the implementation of a on-time access to the data: the EDF
class would know where to find certain parts of the file and load them whenever needed instead of storing the whole file's contents on RAM memory.
Those are the currently available methods for this class.
This is the constructor. It requires a string that describes the path to the EDF file.
- Gets the file path.
- Return: the file path;
- Gets raw EDF header.
- Gets raw EDF records
- Get the labels contained in this EDF file.
- Gets the sampling rate of the recording.
- Formats the read records into the ASCII format and saves it into memory.
- Paramter
filePath
: the path to the file to be written.
- Writes a determined record to a file.
- Parameter
filePath
: the path to the file to be written - Parameter
channel
: the label of the record to be saved on memory
- Gets a list of the annotations on the EDF file, lest there are annotations.
- Returns an array containing one annotation for each entry.
- Gets the convertion factor related to the given label
- Parameter
label
: the channel's label whose convertion factor we want - Returns the convertion factor.
- Get a signal based on its label.
- Parameter
label
: the signal label. - Returns the translated record.
- Translates the loaded EDF file into a CSV table.
- Parameter
filePath
: the file name on which the data must be saved
Mostly holds some utility functions to help with EDF processing.
- Separates a string into equal length chops.
- Creates a new string uniting strings with a separator in the middle.
- Parameter
inlet
: the String array to be united. - Parameter
sep
: the String that will appear in the middle of the other strings. - Returns the united string.