...
 
Commits (322)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -12,7 +12,7 @@ PROJECT(OpenViBE)
# These versions are used by the subprojects by default.
# If you wish to maintain specific version numbers for a subproject, please do so in the projects CMakeLists.txt
SET(OV_GLOBAL_VERSION_MAJOR 2)
SET(OV_GLOBAL_VERSION_MINOR 1)
SET(OV_GLOBAL_VERSION_MINOR 2)
SET(OV_GLOBAL_VERSION_PATCH 0)
SET(OV_GLOBAL_VERSION_STRING "${OV_GLOBAL_VERSION_MAJOR}.${OV_GLOBAL_VERSION_MINOR}.${OV_GLOBAL_VERSION_PATCH}")
......@@ -20,7 +20,19 @@ SET(DOCUMENTATION_TEMP_DIRECTORY "${CMAKE_INSTALL_PREFIX}/doc-tmp")
MESSAGE(STATUS "Appending compilation flags...")
LIST(APPEND LIST_DEPENDENCIES_PATH "${CMAKE_SOURCE_DIR}/dependencies")
IF(WIN32)
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
SET(OV_DEPENDENCIES_PLATFORM_FOLDER_NAME "dependencies_x64")
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
SET(OV_DEPENDENCIES_PLATFORM_FOLDER_NAME "dependencies")
ELSE()
SET(OV_DEPENDENCIES_PLATFORM_FOLDER_NAME "dependencies")
ENDIF()
ELSE()
SET(OV_DEPENDENCIES_PLATFORM_FOLDER_NAME "dependencies")
ENDIF()
LIST(APPEND LIST_DEPENDENCIES_PATH "${CMAKE_SOURCE_DIR}/${OV_DEPENDENCIES_PLATFORM_FOLDER_NAME}")
# Setup knowledge of GNU-style install path variables
INCLUDE("GNUInstallDirs")
......@@ -112,7 +124,10 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
IF(WIN32)
# Switch /arch:SSE2 enables vectorization. Remove if your CPU/compiler doesn't support it.
SET(OV_EIGEN_FLAGS "/arch:SSE2")
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
SET(OV_EIGEN_FLAGS "/arch:SSE2")
ENDIF()
# The following is needed to keep OpenMP from hogging all the cores. Note that this env var works only for VS2013+.
# On VS2010, it may be better to disable OpenMP.
SET(OV_OMP_WAIT_POLICY "PASSIVE")
......@@ -186,17 +201,15 @@ ENDIF()
# ENDIF()
FUNCTION(SET_BUILD_PLATFORM)
IF(WIN32)
# For some drivers/libs we presently need i386 (at least for Acquisition Server)
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_x64)
SET(PLATFORM_TARGET "x64" PARENT_SCOPE)
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_i386)
SET(PLATFORM_TARGET "x86" PARENT_SCOPE)
ELSE()
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_x64)
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_i386)
ELSE()
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_Unknown)
ENDIF()
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_Unknown)
SET(PLATFORM_TARGET "unknown" PARENT_SCOPE)
ENDIF()
IF(WIN32)
......@@ -215,6 +228,10 @@ FUNCTION(SET_BUILD_PLATFORM)
ENDIF()
ENDFUNCTION()
# In extras/ we assume that everything is built onto the same platform.
# It is very error prone to leave this to the modules.
SET_BUILD_PLATFORM()
# Print the used compilation parameters (for transparency)
GET_DIRECTORY_PROPERTY(TMP_DEFINITIONS COMPILE_DEFINITIONS)
MESSAGE(STATUS "Compilation flags used at source root: ")
......@@ -304,11 +321,11 @@ ENDIF(openvibe-documentation)
# make a copy of the dependency script, this is done so we can use the same launch scripts both in win install and win devel situations.
IF(WIN32)
FIND_PATH(OV_DEPENDENCY_CMD_PATH win32-dependencies.cmd PATHS ${LIST_DEPENDENCIES_PATH} NO_DEFAULT_PATH)
FIND_PATH(OV_DEPENDENCY_CMD_PATH windows-dependencies.cmd PATHS ${LIST_DEPENDENCIES_PATH} NO_DEFAULT_PATH)
IF(NOT OV_DEPENDENCY_CMD_PATH)
MESSAGE(FATAL_ERROR "Dependency installer should have generated 'win32-dependencies.cmd'. Looked from ${LIST_DEPENDENCIES_PATH}.")
MESSAGE(FATAL_ERROR "Dependency installer should have generated 'windows-dependencies.cmd'. Looked from ${LIST_DEPENDENCIES_PATH}.")
ENDIF()
INSTALL(PROGRAMS ${OV_DEPENDENCY_CMD_PATH}/win32-dependencies.cmd DESTINATION ${DIST_BINDIR} RENAME "openvibe-set-env.cmd")
INSTALL(PROGRAMS ${OV_DEPENDENCY_CMD_PATH}/windows-dependencies.cmd DESTINATION ${DIST_BINDIR} RENAME "openvibe-set-env.cmd")
ENDIF(WIN32)
......
......@@ -406,8 +406,8 @@
<Setting>
<TypeIdentifier>(0x330306dd, 0x74a95f98)</TypeIdentifier>
<Name>Cue Image 1</Name>
<DefaultValue>${Path_Data}/plugins/simple-visualisation/p300-magic-card/01.png</DefaultValue>
<Value>${Path_Data}/plugins/simple-visualisation/p300-magic-card/01.png</Value>
<DefaultValue>${Path_Data}/plugins/simple-visualization/p300-magic-card/01.png</DefaultValue>
<Value>${Path_Data}/plugins/simple-visualization/p300-magic-card/01.png</Value>
<Modifiability>false</Modifiability>
</Setting>
<Setting>
......@@ -420,8 +420,8 @@
<Setting>
<TypeIdentifier>(0x330306dd, 0x74a95f98)</TypeIdentifier>
<Name>Cue Image 2</Name>
<DefaultValue>${Path_Data}/plugins/simple-visualisation/p300-magic-card/02.png</DefaultValue>
<Value>${Path_Data}/plugins/simple-visualisation/p300-magic-card/02.png</Value>
<DefaultValue>${Path_Data}/plugins/simple-visualization/p300-magic-card/02.png</DefaultValue>
<Value>${Path_Data}/plugins/simple-visualization/p300-magic-card/02.png</Value>
<Modifiability>false</Modifiability>
</Setting>
<Setting>
......@@ -434,8 +434,8 @@
<Setting>
<TypeIdentifier>(0x330306dd, 0x74a95f98)</TypeIdentifier>
<Name>Cue Image 3</Name>
<DefaultValue>${Path_Data}/plugins/simple-visualisation/p300-magic-card/03.png</DefaultValue>
<Value>${Path_Data}/plugins/simple-visualisation/p300-magic-card/03.png</Value>
<DefaultValue>${Path_Data}/plugins/simple-visualization/p300-magic-card/03.png</DefaultValue>
<Value>${Path_Data}/plugins/simple-visualization/p300-magic-card/03.png</Value>
<Modifiability>false</Modifiability>
</Setting>
<Setting>
......@@ -448,7 +448,7 @@
<Setting>
<TypeIdentifier>(0x330306dd, 0x74a95f98)</TypeIdentifier>
<Name>Cue Image 4</Name>
<DefaultValue>${Path_Data}/plugins/simple-visualisation/p300-magic-card/04.png</DefaultValue>
<DefaultValue>${Path_Data}/plugins/simple-visualization/p300-magic-card/04.png</DefaultValue>
<Value>${Path_Data}/applications/vr-demo/handball/scene-graz-cross/cross.png</Value>
<Modifiability>false</Modifiability>
</Setting>
......@@ -462,7 +462,7 @@
<Setting>
<TypeIdentifier>(0x330306dd, 0x74a95f98)</TypeIdentifier>
<Name>Cue Image 5</Name>
<DefaultValue>${Path_Data}/plugins/simple-visualisation/p300-magic-card/07.png</DefaultValue>
<DefaultValue>${Path_Data}/plugins/simple-visualization/p300-magic-card/07.png</DefaultValue>
<Value>${Player_ScenarioDirectory}/assets/rest.png</Value>
<Modifiability>false</Modifiability>
</Setting>
......
<OpenViBE-Classifier-Box XMLVersion="3">
<Strategy-Identifier class-id="(0xffffffff, 0xffffffff)">Native</Strategy-Identifier>
<Algorithm-Identifier class-id="(0x2ba17a3c, 0x1bd46d84)">Linear Discrimimant Analysis (LDA)</Algorithm-Identifier>
<Stimulations>
<Class-Stimulation class-id="1">OVTK_GDF_Left</Class-Stimulation>
<Class-Stimulation class-id="2">OVTK_GDF_Right</Class-Stimulation>
</Stimulations>
<OpenViBE-Classifier>
<LDA>
<Classes>1 2</Classes>
<Weights> -1.390939e+01 -3.837006e+01 -3.951661e+00 1.267055e+02 8.129262e+00 1.130540e+02</Weights>
<Bias-distance>1.04657</Bias-distance>
<Coefficient-probability>1.15779</Coefficient-probability>
</LDA>
</OpenViBE-Classifier>
</OpenViBE-Classifier-Box>
<OpenViBE-Classifier-Box XMLVersion="3">
<Strategy-Identifier class-id="(0xffffffff, 0xffffffff)">Native</Strategy-Identifier>
<Algorithm-Identifier class-id="(0x2ba17a3c, 0x1bd46d84)">Linear Discrimimant Analysis (LDA)</Algorithm-Identifier>
<Stimulations>
<Class-Stimulation class-id="1">OVTK_GDF_Left</Class-Stimulation>
<Class-Stimulation class-id="2">OVTK_GDF_Right</Class-Stimulation>
</Stimulations>
<OpenViBE-Classifier>
<LDA>
<Classes>1 2</Classes>
<Weights> 4.842323e+00 -5.216169e+00</Weights>
<Bias-distance>1.12019</Bias-distance>
<Coefficient-probability>1.23142</Coefficient-probability>
</LDA>
</OpenViBE-Classifier>
</OpenViBE-Classifier-Box>
......@@ -13,7 +13,7 @@
# INSTALL(DIRECTORY p300-speller/ DESTINATION ${DIST_DATADIR}/openvibe/bci-examples)
# INSTALL(DIRECTORY p300-speller-xDAWN/ DESTINATION ${DIST_DATADIR}/openvibe/bci-examples)
INSTALL(DIRECTORY signals DESTINATION ${DIST_DATADIR}/openvibe/scenarios/)
# INSTALL(DIRECTORY signals DESTINATION ${DIST_DATADIR}/openvibe/scenarios/)
INSTALL(DIRECTORY bci-examples DESTINATION ${DIST_DATADIR}/openvibe/scenarios/)
# FILE(GLOB FILENAMES "*")
......
<OpenViBE-Classifier-Box XMLVersion="3">
<Strategy-Identifier class-id="(0xffffffff, 0xffffffff)">Native</Strategy-Identifier>
<Algorithm-Identifier class-id="(0x2ba17a3c, 0x1bd46d84)">Linear Discrimimant Analysis (LDA)</Algorithm-Identifier>
<Stimulations>
<Class-Stimulation class-id="1">OVTK_StimulationId_Target</Class-Stimulation>
<Class-Stimulation class-id="2">OVTK_StimulationId_NonTarget</Class-Stimulation>
</Stimulations>
<OpenViBE-Classifier>
<LDA>
<Classes>1 2</Classes>
<Weights> -7.122120e+00 1.777545e+01 -1.781346e+01 -3.329611e+00 2.362203e+01 -1.572492e+01 -1.857913e+01 5.847418e+01 -8.563956e+01 8.832628e+01 -7.905228e+01 7.780925e+01 -8.364732e+01 9.759207e+01 -1.179872e+02 1.286545e+02 -1.241806e+02 8.831794e+01 -2.587511e+01 -3.521868e+01 8.543782e+01 -1.118077e+02 9.711441e+01 -6.245437e+01 2.334095e+01 1.967654e+01 -5.167139e+01 5.649979e+01 -4.220202e+01 3.378016e+01 -4.860022e+01 7.126221e+01 -8.544855e+01 8.355727e+01 -5.776034e+01 8.339217e+00 5.205719e+01 -1.031671e+02 1.253024e+02 -1.179639e+02 8.326497e+01 -4.730102e+01 2.565054e+01 -3.170866e+01 6.398977e+01 -1.149526e+02 1.650408e+02 -1.922100e+02 2.000919e+02 -2.092701e+02 2.045770e+02 -1.861620e+02 1.561740e+02 -1.196765e+02 8.973211e+01 -6.411192e+01 4.368705e+01 -3.867175e+01 3.209337e+01 -2.468713e+01 6.344738e+00 2.250683e+01 -3.921717e+01 3.693119e+01 -3.696910e+01 4.548092e+01 -5.187682e+01 3.650097e+01 3.406524e+00 -5.269095e+01 8.947779e+01 -1.032946e+02 8.152717e+01 -3.928739e+01 5.936262e+00 3.519896e+00 -1.329417e+01 3.458413e+01 -5.255438e+01 7.238334e+01 -1.050424e+02 1.339581e+02 -1.370269e+02 1.226060e+02 -9.643596e+01 6.466838e+01 -5.095871e+01 7.402919e+01 -1.127270e+02 1.304361e+02 -1.327929e+02 1.215212e+02 -8.866220e+01 2.535216e+01 4.486416e+01 -8.007328e+01 6.169344e+01 -7.344700e+00 -4.270434e+01 5.254071e+01 -4.121132e+01 4.482422e+01 -7.372178e+01 1.052715e+02 -1.101813e+02 7.074318e+01 -3.479241e+00 -6.210279e+01 1.083678e+02 -1.321705e+02 1.294090e+02 -9.968801e+01 4.750835e+01 1.084392e+01 -5.011680e+01 6.152786e+01 -5.172693e+01 1.322513e+01 3.696735e+01 -7.198078e+01 7.012957e+01 -5.315045e+01 2.909352e+01 -1.046225e+01 4.802064e+00 -1.995977e+01 4.139408e+01 -6.684648e+01 8.761406e+01 -8.690807e+01 5.571024e+01 -1.797395e+01 -3.284783e+00 -3.856386e+00 2.105352e+01 -3.231356e+01 1.677828e+01 2.125954e+01 -5.860028e+01 7.830651e+01 -9.015548e+01 9.728995e+01 -9.893630e+01 9.542621e+01 -9.783217e+01 1.083699e+02 -1.210458e+02 1.206111e+02 -1.071788e+02 7.687832e+01 -3.859535e+01 7.913590e+00 1.356120e+01 -4.051088e+01 7.043170e+01 -1.018706e+02 1.391827e+02 -1.632443e+02 1.609274e+02 -1.373878e+02 1.019344e+02 -6.696022e+01 6.250240e+01 -9.914957e+01 1.525926e+02 -1.905768e+02 2.112993e+02 -2.079184e+02 1.786620e+02 -1.177934e+02 4.202581e+01 7.082889e+00 -4.850787e+00 -4.193205e+01 9.702879e+01 -1.207281e+02 1.136234e+02 -1.068530e+02 1.124635e+02 -1.177883e+02 1.070995e+02 -7.928295e+01 3.244891e+01 2.540448e+01 -6.783156e+01 8.252935e+01 -6.874371e+01 4.088874e+01 5.789947e+00 -4.716482e+01 6.971631e+01 -6.269533e+01 3.411818e+01 1.878494e+01 -7.067014e+01 1.083944e+02 -1.248790e+02 1.211853e+02 -9.780863e+01 7.581420e+01 -8.356914e+01 1.212675e+02 -1.603997e+02 1.881428e+02 -2.005041e+02 1.855934e+02 -1.441734e+02 1.030061e+02 -8.202598e+01 9.333785e+01 -1.122289e+02 1.237476e+02 -1.007398e+02 4.739943e+01 6.899361e+00 -3.125639e+01 4.564319e+01 -5.912309e+01 6.678798e+01 -6.302497e+01 7.019989e+01 -9.116743e+01 1.180301e+02 -1.339850e+02 1.324724e+02 -1.025916e+02 5.063891e+01 -1.257023e+01</Weights>
<Bias-distance>-30.7431</Bias-distance>
<Coefficient-probability>-33.141</Coefficient-probability>
</LDA>
</OpenViBE-Classifier>
</OpenViBE-Classifier-Box>
<OpenViBE-SettingsOverride>
<SettingValue>Epoch block average</SettingValue>
<SettingValue>3</SettingValue>
<SettingValue>1</SettingValue>
</OpenViBE-SettingsOverride>
function arrayMax(a)
if #a == 0 then return nil, nil end
local maxIdx, maxValue = 0, a[0]
for i = 1, (#a -1 ) do
if maxValue < a[i] then
maxIdx, maxValue = i, a[i]
end
end
return maxIdx, maxValue
end
-- For handling target fifo
List = {}
function List.new ()
return {first = 0, last = -1}
end
function List.pushright (list, value)
local last = list.last + 1
list.last = last
list[last] = value
end
function List.popleft (list)
local first = list.first
if first > list.last then
error("list is empty")
end
local value = list[first]
list[first] = nil -- to allow garbage collection
list.first = first + 1
return value
end
function List.isempty (list)
if list.first > list.last then
return true
else
return false
end
end
-- this function is called when the box is initialized
function initialize(box)
dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua")
row_base = _G[box:get_setting(2)]
segment_start = _G[box:get_setting(3)]
segment_stop = _G[box:get_setting(4)]
-- 0 inactive, 1 segment started, 2 segment stopped (can vote)
segment_status = 0
-- the idea is to push the flash states to the fifo, and when predictions arrive (with some delay), they are matched in oldest-first fashion.
target_fifo = List.new()
-- box:log("Info", string.format("pop %d %d", id[1], id[2]))
row_votes = {}
do_debug = false
end
-- this function is called when the box is uninitialized
function uninitialize(box)
end
function process(box)
-- loops until box is stopped
while box:keep_processing() do
-- first, parse the timeline stream
for stimulation = 1, box:get_stimulation_count(2) do
-- gets the received stimulation
local identifier, date, duration = box:get_stimulation(2, 1)
-- discards it
box:remove_stimulation(2, 1)
if identifier == segment_start then
if do_debug then
box:log("Info", string.format("Trial start"))
box:log("Info", string.format("Clear votes"))
end
-- zero the votes
row_votes = {}
target_fifo = List.new()
-- fixme fixed 20
for i = 0,20 do
row_votes[i] = 0
end
segment_status = 1
end
-- Does the identifier code a flash? if so, put into fifo
if segment_status == 1 and identifier >= row_base and identifier <= OVTK_StimulationId_LabelEnd then
local t = {"row", identifier - row_base}
List.pushright(target_fifo,t)
if do_debug then
box:log("Info", string.format("Push row target %d", identifier - row_base ))
end
end
if identifier == segment_stop then
if do_debug then
box:log("Info", string.format("Trial stop"))
end
segment_status = 2
end
end
-- then parse the classifications
for stimulation = 1, box:get_stimulation_count(1) do
-- gets the received stimulation
local identifier, date, duration = box:get_stimulation(1, 1)
-- discards it
box:remove_stimulation(1, 1)
-- Is it an in-class prediction?
if identifier == OVTK_StimulationId_Target then
local t = List.popleft(target_fifo)
if do_debug then
box:log("Info", string.format("Pred fifo %s %d is target", t[1], t[2]))
end
if t[1]=="row" then
row_votes[t[2]] = row_votes[t[2]] + 1
end
end
if identifier == OVTK_StimulationId_NonTarget then
local t = List.popleft(target_fifo)
if do_debug then
box:log("Info", string.format("Pred fifo %s %d is nontarget", t[1], t[2]))
end
-- vote not added in this case
end