Example
|
#include "Capsule/CDefinesPrivate.h"
#include "Capsule/CError.h"
#include "Capsule/CNFBCalibrator.h"
#include "Capsule/CSession.h"
Go to the source code of this file.
Classes | |
struct | clCNFBUserState |
User state, determined by NFB classifier. More... | |
Typedefs | |
typedef enum clCNFBCallResult | clCNFBCallResult |
NFB call result. | |
typedef enum ccCNFBState | ccCNFBState |
NFB state. | |
typedef struct clCNFBUserState | clCNFBUserState |
User state, determined by NFB classifier. | |
typedef void(* | clCNFBHandlerNFBUserState) (clCNFB, const clCNFBUserState *) |
typedef void(* | clCNFBHandler) (clCNFB) |
typedef void(* | clCNFBHandlerBool) (clCNFB, bool) |
typedef void(* | clCNFBHandlerString) (clCNFB, const char *) |
Enumerations | |
enum | clCNFBCallResult { clC_NFB_Success , clC_NFB_NotInitialized , clC_NFB_ModelIsNotTrained , clC_NFB_ModelIsTrained , clC_NFB_FailedToSendData } |
NFB call result. More... | |
enum | ccCNFBState { cc_NFB_Undefined , cc_NFB_Relaxation , cc_NFB_Concentration } |
NFB state. More... | |
Functions | |
CLC_CLASS_WN (ClassificationNFBPrivate, clCNFB) | |
Interface to NFB classification process. | |
CLC_STRUCT (clCNFBDelegateNFBUserState) | |
CL_DLL void | clCNFBDelegateNFBUserState_Set (clCNFBDelegateNFBUserState delegate, clCNFBHandlerNFBUserState callback) NOEXCEPT |
CL_DLL clCNFB | clCNFB_Create (clCSession session) NOEXCEPT |
CL_DLL void | clCNFB_Destroy (clCNFB nfb) NOEXCEPT |
CLC_STRUCT (clCNFBDelegate) | |
CL_DLL void | clCNFBDelegate_Set (clCNFBDelegate delegate, clCNFBHandler callback) NOEXCEPT |
CLC_STRUCT (clCNFBDelegateBool) | |
CL_DLL void | clCNFBDelegateBool_Set (clCNFBDelegateBool delegate, clCNFBHandlerBool callback) NOEXCEPT |
CLC_STRUCT (clCNFBDelegateString) | |
CL_DLL void | clCNFBDelegateString_Set (clCNFBDelegateString delegate, clCNFBHandlerString callback) NOEXCEPT |
CL_DLL clCNFBDelegate | clCNFB_GetOnInitializedEvent (clCNFB nfb) NOEXCEPT |
CL_DLL clCNFBDelegate | clCNFB_GetOnModelTrainedEvent (clCNFB nfb) NOEXCEPT |
CL_DLL clCNFBDelegateBool | clCNFB_GetOnResetEvent (clCNFB nfb) NOEXCEPT |
CL_DLL clCNFBDelegateNFBUserState | clCNFB_GetOnUserStateChangedEvent (clCNFB nfb) NOEXCEPT |
CL_DLL clCNFBDelegateString | clCNFB_GetOnErrorEvent (clCNFB nfb) NOEXCEPT |
CL_DLL clCNFBCallResult | clCNFB_Initialize (clCNFB nfb) NOEXCEPT |
Request initialization. | |
CL_DLL clCNFBCallResult | clCNFB_InitializeWithPeriod (clCNFB nfb, float userStatePeriod) NOEXCEPT |
Request initialization. | |
CL_DLL clCNFBCallResult | clCNFB_AddFeedbackFunction (clCNFB nfb, const char *feedbackFunction) NOEXCEPT |
Add calculation of neuro feedback with configured output. | |
CL_DLL clCNFBCallResult | clCNFB_Train (clCNFB nfb) NOEXCEPT |
Request training, event is called when training is finished. | |
CL_DLL clCNFBCallResult | clCNFB_Reset (clCNFB nfb) NOEXCEPT |
Request reset, event is called when reset finished. | |
CL_DLL bool | clCNFB_IsInitialized (clCNFB nfb) NOEXCEPT |
Check whether interface was initialized. | |
CL_DLL bool | clCNFB_IsModelTrained (clCNFB nfb) NOEXCEPT |
Check whether model was trained. | |
CL_DLL clCNFB | clCNFB_CreateCalibrated (clCNFBCalibrator calibrator, clCError *error) NOEXCEPT |
CL_DLL clCNFBCallResult | clCNFB_MarkState (clCNFB nfb, ccCNFBState userState) NOEXCEPT |
Mark a change in user state. | |
typedef enum ccCNFBState ccCNFBState |
NFB state.
typedef enum clCNFBCallResult clCNFBCallResult |
NFB call result.
typedef void(* clCNFBHandler) (clCNFB) |
typedef void(* clCNFBHandlerBool) (clCNFB, bool) |
typedef void(* clCNFBHandlerNFBUserState) (clCNFB, const clCNFBUserState *) |
typedef void(* clCNFBHandlerString) (clCNFB, const char *) |
typedef struct clCNFBUserState clCNFBUserState |
User state, determined by NFB classifier.
enum ccCNFBState |
enum clCNFBCallResult |
NFB call result.
CLC_CLASS_WN | ( | ClassificationNFBPrivate | , |
clCNFB | |||
) |
Interface to NFB classification process.
Before calling any of the functions make sure that:
Model might need to be trained before it is able to calculate user state. clCNFB_IsModelTrained will return false
if it needs to be trained.
In order to train model you should:
CLC_STRUCT | ( | clCNFBDelegate | ) |
CLC_STRUCT | ( | clCNFBDelegateBool | ) |
CLC_STRUCT | ( | clCNFBDelegateNFBUserState | ) |
CLC_STRUCT | ( | clCNFBDelegateString | ) |
CL_DLL clCNFBCallResult clCNFB_AddFeedbackFunction | ( | clCNFB | nfb, |
const char * | feedbackFunction | ||
) |
Add calculation of neuro feedback with configured output.
nfb | NFB handle |
feedbackFunction | function of bands, e.g. "(alpha + beta) / theta" |
CL_DLL clCNFB clCNFB_Create | ( | clCSession | session | ) |
Create a NFB classifier.
session | session handle. Valid session must be passed (does not need to be active) |
Create a NFB classifier after individual NFB has calibrated.
calibrator | NFB calibrator handle. A calibrated calibrator must be passed. |
CL_DLL void clCNFB_Destroy | ( | clCNFB | nfb | ) |
Destroy NFB classifier. Release the handle.
nfb | NFB handle |
CL_DLL clCNFBDelegateString clCNFB_GetOnErrorEvent | ( | clCNFB | nfb | ) |
CL_DLL clCNFBDelegate clCNFB_GetOnInitializedEvent | ( | clCNFB | nfb | ) |
CL_DLL clCNFBDelegate clCNFB_GetOnModelTrainedEvent | ( | clCNFB | nfb | ) |
CL_DLL clCNFBDelegateBool clCNFB_GetOnResetEvent | ( | clCNFB | nfb | ) |
CL_DLL clCNFBDelegateNFBUserState clCNFB_GetOnUserStateChangedEvent | ( | clCNFB | nfb | ) |
CL_DLL clCNFBCallResult clCNFB_Initialize | ( | clCNFB | nfb | ) |
Request initialization.
OnInitialized event is called on completion.
nfb | NFB handle |
CL_DLL clCNFBCallResult clCNFB_InitializeWithPeriod | ( | clCNFB | nfb, |
float | userStatePeriod | ||
) |
Request initialization.
OnInitialized event is called on completion.
nfb | NFB handle |
userStateCheckPeriod | period of user state updates |
CL_DLL bool clCNFB_IsInitialized | ( | clCNFB | nfb | ) |
Check whether interface was initialized.
nfb | NFB handle |
CL_DLL bool clCNFB_IsModelTrained | ( | clCNFB | nfb | ) |
Check whether model was trained.
nfb | NFB handle |
CL_DLL clCNFBCallResult clCNFB_MarkState | ( | clCNFB | nfb, |
ccCNFBState | userState | ||
) |
Mark a change in user state.
Used in BCI system to train classifier to discriminate states. Should always end with Undefined state before Train() to mark an ending.
nfb | NFB handle |
userState | state to be marked |
CL_DLL clCNFBCallResult clCNFB_Reset | ( | clCNFB | nfb | ) |
Request reset, event is called when reset finished.
OnReset event is called on completion
nfb | NFB handle |
CL_DLL clCNFBCallResult clCNFB_Train | ( | clCNFB | nfb | ) |
Request training, event is called when training is finished.
OnModelTrained event is called on completion
nfb | NFB handle |
CL_DLL void clCNFBDelegate_Set | ( | clCNFBDelegate | delegate, |
clCNFBHandler | callback | ||
) |
CL_DLL void clCNFBDelegateBool_Set | ( | clCNFBDelegateBool | delegate, |
clCNFBHandlerBool | callback | ||
) |
CL_DLL void clCNFBDelegateNFBUserState_Set | ( | clCNFBDelegateNFBUserState | delegate, |
clCNFBHandlerNFBUserState | callback | ||
) |
CL_DLL void clCNFBDelegateString_Set | ( | clCNFBDelegateString | delegate, |
clCNFBHandlerString | callback | ||
) |