I am trying to learn how to develop an OpenVIBE plugin, starting with a csv Reader. Reference (viewtopic.php?f=10&t=417). I am hoping that others who have experience can help and hopefully the codes here will reach a state that makes it less effort for the OpenVIBE developers to incorporate into the standard distribution.
Motivation:
The binary EDF files exported by Emotiv can be converted into text format using edf2ascii.exe http://www.teuniz.net/edf2ascii/index.html. To bring the signal data and channel information into OpenVIBE, I need two of the generated files:
a) edfFileName_signals.txt (Information on channels, if 16 channels, each line starts with a channel name)
b) edfFileName_data.txt (signal data in csv format, if there are 16 channels, then each line is 16 signal data delimited by ",") Justifications:
(1)The format is very simple and it will help others to convert a proprietory binary format into ascii format for import into OpenVIBE especially when there is no such binary reader exist yet in OpenVIBE.
(2) Many BCI EEG hardware and softwares generate and use binary EDF format. However, the challenge is always how consistent is the binary EDF format. E.g. Emotiv binary EDF format can not be imported into the EDF browser. Therefore, there is an urgent need to have a more robust and more consistent way to convert EDF files from different sources into one that is simple for import into OpenVIBE. The EDFascii seems to be a good option.
Requirements for writing a OpenVIBE Reader:
Step1: Determine the minimum template.h and template.cpp needed for an OpenVIBE Reader.
I am using VS2008, it is straight forwards to generate VS projects using the downloaded 0.9 OpenVIBE source
The project directory needed to write OpenVIBE Reader is in plugins-file-io-dynamic
Guildlines for writing plugin
http://openvibe.inria.fr/documentation/ ... lugin.html
Composition of a plugin Generate Template using openvibe-skeleton-generator.cmd
Code: Select all
#ifndef __OpenViBEPlugins_file_io_CEDFAcsiiFileReader_H__
#define __OpenViBEPlugins_file_io_CEDFAcsiiFileReader_H__
#include "ovp_defines.h"
#include <openvibe/ov_all.h>
#include <openvibe-toolkit/ovtk_all.h>
#include <ebml/TWriterCallbackProxy.h>
#include <ebml/IWriter.h>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
namespace OpenViBEPlugins
{
namespace FileIO
{
class CEDFAcsiiFileReader : public OpenViBEToolkit::TBoxAlgorithm<OpenViBE::Plugins::IBoxAlgorithm>
{
public:
CEDFAcsiiFileReader();
virtual void release(void) { delete this; }
virtual OpenViBE::boolean initialize();
virtual OpenViBE::boolean uninitialize();
virtual OpenViBE::boolean process();
virtual OpenViBE::boolean processClock(OpenViBE::CMessageClock& rMessageClock);
virtual OpenViBE::uint64 getClockFrequency(){ return m_ui64ClockFrequency; }
public:
void writeSignalInformation();
virtual void writeSignalOutput(const void* pBuffer, const EBML::uint64 ui64BufferSize);
virtual void writeStimulationOutput(const void* pBuffer, const EBML::uint64 ui64BufferSize);
_IsDerivedFromClass_Final_( OpenViBE::Plugins:: IBoxAlgorithm, OVP_ClassId_CEDFAcsiiFileReader )
};
};
#endif
Additional references
viewtopic.php?f=3&t=166