...
 
Commits (23)

Too many changes to show.

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

......@@ -12,7 +12,7 @@ if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
PROJECT(OpenVIBE)
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
......@@ -34,6 +34,11 @@ IF(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF(OPENMP_FOUND)
ADD_DEFINITIONS("-DOV_PROJECT_NAME=\"${PROJECT_NAME}\"")
ADD_DEFINITIONS("-DOV_VERSION_MAJOR=\"${OV_GLOBAL_VERSION_MAJOR}\"")
ADD_DEFINITIONS("-DOV_VERSION_MINOR=\"${OV_GLOBAL_VERSION_MINOR}\"")
ADD_DEFINITIONS("-DOV_VERSION_PATCH=\"${OV_GLOBAL_VERSION_PATCH}\"")
IF(WIN32)
ADD_DEFINITIONS("-DNOMINMAX -DBOOST_ALL_NO_LIB")
# Switch /arch:SSE2 enables vectorization. Remove if your CPU/compiler doesn't support it.
......@@ -178,6 +183,7 @@ ADD_DEFINITIONS(-DOV_CMAKE_PATH_BIN="${CMAKE_INSTALL_FULL_BINDIR}")
ADD_DEFINITIONS(-DOV_CMAKE_PATH_DATA="${CMAKE_INSTALL_FULL_DATADIR}/openvibe")
ADD_DEFINITIONS(-DOV_CMAKE_PATH_LIB="${CMAKE_INSTALL_FULL_LIBDIR}")
ADD_SUBDIRECTORY("build-tool/")
# Traverse these directories and build their components
ADD_SUBDIRECTORY("common/")
ADD_SUBDIRECTORY("openvibe/")
......@@ -187,13 +193,14 @@ ADD_SUBDIRECTORY("toolkit/")
ADD_SUBDIRECTORY("plugins/")
ADD_SUBDIRECTORY("applications/")
ADD_SUBDIRECTORY("externals/")
ADD_SUBDIRECTORY("contrib/")
ADD_SUBDIRECTORY("documentation/") # needs to be the last since it uses the list of collected projects
#add dependency to plugin inspector to the documentation
IF(openvibe-documentation)
ADD_DEPENDENCIES(openvibe-documentation openvibe-plugin-inspector)
ENDIF(openvibe-documentation)
ADD_DEPENDENCIES(openvibe-toolkit openvibe-stimulation-generator )
# 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)
INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/scripts/win32-dependencies.cmd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} RENAME "openvibe-set-env.cmd")
......
# Add all the subdirs as projects of the named branch
OV_ADD_PROJECTS("APPLICATIONS_DEMOS")
# INSTALL(DIRECTORY signals DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/openvibe/scenarios/ PATTERN ".svn" EXCLUDE)
INSTALL(DIRECTORY bci-examples DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/openvibe/scenarios/ PATTERN ".svn" EXCLUDE)
<OpenViBE-SettingsOverride>
<SettingValue>2.703843e-01 -2.033501e-01 2.403197e-01 2.356381e-01 3.924335e-01 2.392063e-01 1.126995e-01 5.732521e-01 3.104990e-01 2.895368e-01 1.986909e-01 -2.802677e-01 8.642671e-02 -2.668902e-01 -2.873131e-01 -3.079679e-01 -2.311899e-01 -3.049967e-01 -3.204300e-01 -4.425812e-01 -2.982544e-01 -3.624583e-01 -1.743516e-02 -7.034854e-01 -5.985984e-03 -1.229407e-01 1.248006e-01 2.071428e-02 6.843323e-02 -2.541336e-01 -2.561801e-01 -3.879860e-01 4.338449e-01 1.443236e-01 3.069893e-01 3.027873e-01 3.956782e-01 2.813831e-01 2.775939e-01 3.539175e-01 2.829925e-01 3.027860e-01 3.108203e-01 2.946542e-01 8.225417e-01 2.972165e-01 1.898254e-01 2.250985e-01 1.687560e-01 -1.534876e-01 -2.300926e-01 4.962169e-02 1.434810e-01 1.137737e-01 8.608912e-02 2.163422e-01 2.683768e-01 3.076638e-01 3.600548e-01 3.077418e-01 2.519825e-01 2.256518e-01 3.292366e-01 2.892911e-01 3.994613e-01 3.099987e-01 </SettingValue>
<SettingValue>6</SettingValue>
<SettingValue>11</SettingValue>
<SettingValue></SettingValue>
</OpenViBE-SettingsOverride>
<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>
g_offset = nil
g_duration = nil
-- 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")
g_offset = box:get_setting(2)
g_duration = box:get_setting(3)
end
-- this function is called when the box is uninitialized
function uninitialize(box)
end
function wait_until(box, time)
while box:get_current_time() < time do
box:sleep()
end
end
function wait_for(box, duration)
wait_until(box, box:get_current_time() + duration)
end
function process(box)
-- loops on every received stimulation for a given input
while box:keep_processing() do
for stimulation = 1, box:get_stimulation_count(1) do
-- gets the received stimulation
identifier, date, duration = box:get_stimulation(1, 1)
-- discards it
box:remove_stimulation(1, 1)
-- delay the OVTK_GDF_Left and Right
if identifier == OVTK_GDF_Left or identifier == OVTK_GDF_Right then
box:send_stimulation(1, OVTK_GDF_Correct, date+g_offset, 0)
box:send_stimulation(1, OVTK_GDF_Incorrect, date+g_offset+g_duration, 0)
end
end
box:sleep()
end
end
function initialize(box)
dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua")
number_of_trials = box:get_setting(2)
first_class = _G[box:get_setting(3)]
second_class = _G[box:get_setting(4)]
baseline_duration = box:get_setting(5)
wait_for_beep_duration = box:get_setting(6)
wait_for_cue_duration = box:get_setting(7)
display_cue_duration = box:get_setting(8)
feedback_duration = box:get_setting(9)
end_of_trial_min_duration = box:get_setting(10)
end_of_trial_max_duration = box:get_setting(11)
-- initializes random seed
math.randomseed(os.time())
-- fill the sequence table with predifined order
sequence = {}
for i = 1, number_of_trials do
table.insert(sequence, 1, first_class)
table.insert(sequence, 1, second_class)
end
-- randomize the sequence
for i = 1, number_of_trials do
a = math.random(1, number_of_trials*2)
b = math.random(1, number_of_trials*2)
swap = sequence[a]
sequence[a] = sequence[b]
sequence[b] = swap
end
end
function process(box)
local t=0
-- manages baseline
box:send_stimulation(1, OVTK_StimulationId_ExperimentStart, t, 0)
t = t + 5
box:send_stimulation(1, OVTK_StimulationId_BaselineStart, t, 0)
box:send_stimulation(1, OVTK_StimulationId_Beep, t, 0)
t = t + baseline_duration
box:send_stimulation(1, OVTK_StimulationId_BaselineStop, t, 0)
box:send_stimulation(1, OVTK_StimulationId_Beep, t, 0)
t = t + 5
-- manages trials
for i = 1, number_of_trials*2 do
-- first display cross on screen
box:send_stimulation(1, OVTK_GDF_Start_Of_Trial, t, 0)
box:send_stimulation(1, OVTK_GDF_Cross_On_Screen, t, 0)
t = t + wait_for_beep_duration
-- warn the user the cue is going to appear
box:send_stimulation(1, OVTK_StimulationId_Beep, t, 0)
t = t + wait_for_cue_duration
-- display cue
box:send_stimulation(1, sequence[i], t, 0)
t = t + display_cue_duration
-- provide feedback
box:send_stimulation(1, OVTK_GDF_Feedback_Continuous, t, 0)
t = t + feedback_duration
-- ends trial
box:send_stimulation(1, OVTK_GDF_End_Of_Trial, t, 0)
t = t + math.random(end_of_trial_min_duration, end_of_trial_max_duration)
end
-- send end for completeness
box:send_stimulation(1, OVTK_GDF_End_Of_Session, t, 0)
t = t + 5
box:send_stimulation(1, OVTK_StimulationId_Train, t, 0)
t = t + 1
-- used to cause the acquisition scenario to stop
box:send_stimulation(1, OVTK_StimulationId_ExperimentStop, t, 0)
end
This diff is collapsed.
This diff is collapsed.