init
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_addInputBuffer.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 13 Jan. 2012
|
||||
|
||||
% Appends a new signal chunk to a signal input buffer in a matlab box instance.
|
||||
% -------------------------------
|
||||
% MEANT TO BE USED BY OPENVIBE
|
||||
|
||||
function box_out = OV_addInputBuffer(box_in, input_index, start_time, end_time, matrix_data)
|
||||
|
||||
chunk.start_time = start_time;
|
||||
chunk.end_time = end_time;
|
||||
chunk.matrix_data = matrix_data;
|
||||
box_in.inputs{input_index}.buffer{size(box_in.inputs{input_index}.buffer,2)+1} = chunk;
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_addOutputBuffer.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 13 Jan. 2012
|
||||
|
||||
% Appends a new chunk in an output buffer,
|
||||
% meant to be popped by the openvibe box.
|
||||
% -------------------------------
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function box_out = OV_addOutputBuffer(box_in, output_index, start_time, end_time, matrix_data)
|
||||
|
||||
chunk.start_time = start_time;
|
||||
chunk.end_time = end_time;
|
||||
chunk.matrix_data = matrix_data;
|
||||
box_in.outputs{output_index}.buffer{size(box_in.outputs{output_index}.buffer,2)+1} = chunk;
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_createBoxInstance.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
%
|
||||
% This file is meant to be executed prior to any user defined script.
|
||||
% It construct the objects used by the other functions of the toolkit
|
||||
% MEANT TO BE USED BY OPENVIBE
|
||||
%
|
||||
%out
|
||||
|
||||
|
||||
function box = OV_createBoxInstance(input_count, output_count)
|
||||
|
||||
box = [];
|
||||
box.settings = [];
|
||||
box.inputs = {};
|
||||
for i = 1 : input_count
|
||||
box.inputs{i}.header = {};
|
||||
box.inputs{i}.buffer = {};
|
||||
end
|
||||
|
||||
box.outputs = {};
|
||||
for i = 1 : output_count
|
||||
box.outputs{i}.header = {};
|
||||
box.outputs{i}.buffer = {};
|
||||
end
|
||||
box.user_data = {};
|
||||
|
||||
box.clock = 0;
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_define.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% This file is meant to be executed prior to any user defined script.
|
||||
% It declare all stim IDs as variable for use by the user.
|
||||
% MEANT TO BE CALLED BY OPENVIBE
|
||||
%
|
||||
% Stimulation codes
|
||||
% Originally from openvibe-toolkit/ovtk_defines.h
|
||||
|
||||
|
||||
function OV_define()
|
||||
|
||||
% STREAM TYPES:
|
||||
global OV_TypeId_EBMLStream;
|
||||
OV_TypeId_EBMLStream = uint64(hex2dec('434F65872EFD2B7E'));
|
||||
global OV_TypeId_ChannelLocalisation;
|
||||
OV_TypeId_ChannelLocalisation = uint64(hex2dec('013DF452A3A8879A'));
|
||||
global OV_TypeId_ExperimentationInformation; % deprecated
|
||||
OV_TypeId_ExperimentationInformation = uint64(hex2dec('403488E7565D70B6')); % deprecated
|
||||
global OV_TypeId_ExperimentInfo;
|
||||
OV_TypeId_ExperimentInfo = uint64(hex2dec('403488E7565D70B6'));
|
||||
global OV_TypeId_Stimulations;
|
||||
OV_TypeId_Stimulations = uint64(hex2dec('6F752DD0082A321E'));
|
||||
global OV_TypeId_StreamedMatrix;
|
||||
OV_TypeId_StreamedMatrix = uint64(hex2dec('544A003E6DCBA5F6'));
|
||||
global OV_TypeId_FeatureVector;
|
||||
OV_TypeId_FeatureVector = uint64(hex2dec('17341935152FF448'));
|
||||
global OV_TypeId_Signal;
|
||||
OV_TypeId_Signal = uint64(hex2dec('5BA36127195FEAE1'));
|
||||
global OV_TypeId_Spectrum;
|
||||
OV_TypeId_Spectrum = uint64(hex2dec('1F261C0A593BF6BD'));
|
||||
|
||||
% SETTING TYPES:
|
||||
global OV_TypeId_Boolean;
|
||||
OV_TypeId_Boolean = uint64(hex2dec('2CDB2F0B12F231EA'));
|
||||
global OV_TypeId_Integer;
|
||||
OV_TypeId_Integer = uint64(hex2dec('007DEEF92F3E95C6'));
|
||||
global OV_TypeId_Float;
|
||||
OV_TypeId_Float = uint64(hex2dec('512A166F5C3EF83F'));
|
||||
global OV_TypeId_String;
|
||||
OV_TypeId_String = uint64(hex2dec('79A9EDEB245D83FC'));
|
||||
global OV_TypeId_Filename;
|
||||
OV_TypeId_Filename = uint64(hex2dec('330306DD74A95F98'));
|
||||
global OV_TypeId_Script;
|
||||
OV_TypeId_Script = uint64(hex2dec('B0D0DB4549CBC34A'));
|
||||
global OV_TypeId_Stimulation;
|
||||
OV_TypeId_Stimulation = uint64(hex2dec('2C132D6E44AB0D97'));
|
||||
global OV_TypeId_LogLevel;
|
||||
OV_TypeId_LogLevel = uint64(hex2dec('A88B36670871638C'));
|
||||
global OV_TypeId_Color;
|
||||
OV_TypeId_Color = uint64(hex2dec('7F45A2A97DB12219'));
|
||||
global OV_TypeId_ColorGradient;
|
||||
OV_TypeId_ColorGradient = uint64(hex2dec('3D3C7C7FEF0E7129'));
|
||||
|
||||
|
||||
% STIM CODES:
|
||||
global OVTK_StimulationId_LabelStart;
|
||||
OVTK_StimulationId_LabelStart = uint64(hex2dec('00008100'));
|
||||
global OVTK_StimulationId_LabelEnd;
|
||||
OVTK_StimulationId_LabelEnd = uint64(hex2dec('000081ff'));
|
||||
|
||||
global OVTK_StimulationId_NumberStart;
|
||||
OVTK_StimulationId_NumberStart = uint64(hex2dec('00000000'));
|
||||
global OVTK_StimulationId_NumberEnd;
|
||||
OVTK_StimulationId_NumberEnd = uint64(hex2dec('000000ff'));
|
||||
end
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getSignalOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function [errno, nb_channels, channel_names, dynamic] = OV_getChannelLocalisationOutputHeader(box_in, output_index)
|
||||
|
||||
if(numel(box_in.outputs{output_index}.header) == 0)
|
||||
nb_channels = 0;
|
||||
channel_names = 0;
|
||||
dynamic = 0;
|
||||
errno = 1;
|
||||
else
|
||||
nb_channels = box_in.outputs{output_index}.header.nb_channels;
|
||||
channel_names = box_in.outputs{output_index}.header.channel_names;
|
||||
dynamic = box_in.outputs{output_index}.header.dynamic;
|
||||
errno = 0;
|
||||
end
|
||||
|
||||
end
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getSignalOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function [errno, nb_features, labels] = OV_getFeatureVectorOutputHeader(box_in, output_index)
|
||||
|
||||
if(numel(box_in.outputs{output_index}.header) == 0)
|
||||
nb_features = 0;
|
||||
labels = 0;
|
||||
errno = 1;
|
||||
else
|
||||
nb_features = box_in.outputs{output_index}.header.nb_features;
|
||||
labels = box_in.outputs{output_index}.header.labels;
|
||||
errno = 0;
|
||||
end
|
||||
|
||||
end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_hasPendingInputChunk.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 13 Jan. 2012
|
||||
|
||||
% Tests if there is pending Input chunk in the buffer
|
||||
% -------------------------------
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function nb_pending = OV_getNbPendingInputChunk(box_in, input_index)
|
||||
|
||||
if(input_index > size(box_in.inputs,2))
|
||||
disp('Error while calling OV_getNbPendingOutputChunk : output index out-of-range.')
|
||||
nb_pending = 0;
|
||||
else
|
||||
nb_pending = size(box_in.inputs{input_index}.buffer,2);
|
||||
end
|
||||
|
||||
end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_hasPendingOutputChunk.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 13 Jan. 2012
|
||||
|
||||
% Tests if there is pending output chunk in the buffer
|
||||
% -------------------------------
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function nb_pending = OV_getNbPendingOutputChunk(box_in, output_index)
|
||||
|
||||
if(output_index > size(box_in.outputs,2))
|
||||
disp('Error while calling OV_getNbPendingOutputChunk : output index out-of-range.')
|
||||
nb_pending = 0;
|
||||
else
|
||||
nb_pending = size(box_in.outputs{output_index}.buffer,2);
|
||||
end
|
||||
|
||||
end
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getSignalOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function [errno, nb_channels, nb_samples_per_buffer, channel_names, sampling_rate] = OV_getSignalOutputHeader(box_in, output_index)
|
||||
|
||||
if(numel(box_in.outputs{output_index}.header) == 0)
|
||||
nb_channels = 0;
|
||||
nb_samples_per_buffer = 0;
|
||||
channel_names = 0;
|
||||
sampling_rate = 0;
|
||||
errno = 1;
|
||||
else
|
||||
nb_channels = box_in.outputs{output_index}.header.nb_channels;
|
||||
nb_samples_per_buffer = box_in.outputs{output_index}.header.nb_samples_per_buffer;
|
||||
channel_names = box_in.outputs{output_index}.header.channel_names;
|
||||
sampling_rate = box_in.outputs{output_index}.header.sampling_rate;
|
||||
errno = 0;
|
||||
end
|
||||
|
||||
end
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getSpectrumOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function [errno, nb_channels, channel_names, nb_abscissas, abscissas_names, abscissas_linear, sampling_rate] = OV_getSpectrumOutputHeader(box_in, output_index)
|
||||
|
||||
if(numel(box_in.outputs{output_index}.header) == 0)
|
||||
nb_channels = 0;
|
||||
channel_names = 0;
|
||||
nb_abscissas = 0;
|
||||
abscissas_names = 0;
|
||||
abscissas_linear = 0;
|
||||
sampling_rate = 0;
|
||||
errno = 1;
|
||||
else
|
||||
nb_channels = box_in.outputs{output_index}.header.nb_channels;
|
||||
channel_names = box_in.outputs{output_index}.header.channel_names;
|
||||
|
||||
nb_abscissas = box_in.outputs{output_index}.header.nb_abscissas;
|
||||
abscissas_names = box_in.outputs{output_index}.header.abscissas_names;
|
||||
abscissas_linear = box_in.outputs{output_index}.header.abscissas;
|
||||
%reshape(box_in.outputs{output_index}.header.bands,1,numel(box_in.outputs{output_index}.header.bands));
|
||||
sampling_rate = box_in.outputs{output_index}.header.sampling_rate;
|
||||
errno = 0;
|
||||
end
|
||||
end
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getStimulationOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function OV_getStimulationOutputHeader(box_in, output_index)
|
||||
|
||||
%This function does nothing, the stimulation header is empty.
|
||||
|
||||
end
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getStimulationOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function OV_getStimulationsOutputHeader(box_in, output_index)
|
||||
|
||||
%This function does nothing, the stimulation header is empty.
|
||||
|
||||
end
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
% openvibe toolbox for Matlab
|
||||
% OV_getStreamedMatrixOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function [errno, nb_dimensions, dimension_sizes, dimension_labels] = OV_getStreamedMatrixOutputHeader(box_in, output_index)
|
||||
|
||||
if(numel(box_in.outputs{output_index}.header) == 0)
|
||||
nb_dimensions = 0;
|
||||
dimension_sizes = 0;
|
||||
dimension_labels = 0;
|
||||
errno = 1;
|
||||
else
|
||||
nb_dimensions = box_in.outputs{output_index}.header.nb_dimensions;
|
||||
dimension_sizes = box_in.outputs{output_index}.header.dimension_sizes;
|
||||
dimension_labels = box_in.outputs{output_index}.header.dimension_labels;
|
||||
errno = 0;
|
||||
end
|
||||
|
||||
end
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_popInputBuffer.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 13 Jan. 2012
|
||||
|
||||
% Pops the first signal chunk on an input
|
||||
% -------------------------------
|
||||
% output = matrix data (matlab format)
|
||||
% -------------------------------
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function [box_out, start_time,end_time, matrix_data] = OV_popInputBuffer(box_in, input_index)
|
||||
|
||||
if size(box_in.inputs{input_index}.buffer,2) == 0
|
||||
start_time = -1;
|
||||
end_time = -1;
|
||||
matrix_data = [];
|
||||
else
|
||||
start_time = box_in.inputs{input_index}.buffer{1}.start_time;
|
||||
end_time = box_in.inputs{input_index}.buffer{1}.end_time;
|
||||
matrix_data = box_in.inputs{input_index}.buffer{1}.matrix_data;
|
||||
end
|
||||
|
||||
box_in.inputs{input_index}.buffer = box_in.inputs{input_index}.buffer(2:end);
|
||||
|
||||
box_out = box_in;
|
||||
|
||||
end
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_popOutputBuffer.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% pops the last chunk in the output buffer
|
||||
% MEANT TO BE USED IN OPENVIBE
|
||||
|
||||
function [box_out, start_time, end_time, linear_matrix_size, linear_data] = OV_popOutputBuffer(box_in, output_index)
|
||||
|
||||
if size(box_in.outputs{output_index}.buffer,1) == 0
|
||||
start_time = -1;
|
||||
end_time = -1;
|
||||
linear_data = [];
|
||||
linear_matrix_size = 0;
|
||||
else
|
||||
start_time = box_in.outputs{output_index}.buffer{1}.start_time;
|
||||
end_time = box_in.outputs{output_index}.buffer{1}.end_time;
|
||||
nb_elements = size(box_in.outputs{output_index}.buffer{1}.matrix_data(1:end),2);
|
||||
linear_data = box_in.outputs{output_index}.buffer{1}.matrix_data;
|
||||
linear_matrix_size = nb_elements;
|
||||
end
|
||||
|
||||
box_in.outputs{output_index}.buffer = box_in.outputs{output_index}.buffer(2:end);
|
||||
|
||||
box_out = box_in;
|
||||
|
||||
end
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_popOutputBufferReshape.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% pops the last chunk in the output buffer
|
||||
% MEANT TO BE USED IN OPENVIBE
|
||||
|
||||
function [box_out, start_time, end_time, linear_matrix_size, linear_data] = OV_popOutputBufferReshape(box_in, output_index)
|
||||
|
||||
if size(box_in.outputs{output_index}.buffer,1) == 0
|
||||
start_time = -1;
|
||||
end_time = -1;
|
||||
linear_data = [];
|
||||
linear_matrix_size = 0;
|
||||
else
|
||||
start_time = box_in.outputs{output_index}.buffer{1}.start_time;
|
||||
end_time = box_in.outputs{output_index}.buffer{1}.end_time;
|
||||
nb_elements = numel(box_in.outputs{output_index}.buffer{1}.matrix_data);
|
||||
linear_data = reshape(box_in.outputs{output_index}.buffer{1}.matrix_data',1,nb_elements);
|
||||
linear_matrix_size = nb_elements;
|
||||
end
|
||||
|
||||
box_in.outputs{output_index}.buffer = box_in.outputs{output_index}.buffer(2:end);
|
||||
|
||||
box_out = box_in;
|
||||
|
||||
end
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setChannelLocalizationInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Channel Localization input.
|
||||
|
||||
function box_out = OV_setChannelLocalisationInputHeader(box_in, input_index, nb_channels, channel_names, dynamic)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Channel Localisation Stream';
|
||||
box_in.inputs{input_index}.header.nb_channels = nb_channels;
|
||||
box_in.inputs{input_index}.header.channel_names = channel_names;
|
||||
box_in.inputs{input_index}.header.dynamic = dynamic;
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setChannelLocalizationInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Channel Localization input.
|
||||
|
||||
function box_out = OV_setChannelLocalisationOutputHeader(box_in, output_index, nb_channels, channel_names, dynamic)
|
||||
|
||||
box_in.output{output_index}.header.type = 'Channel Localisation Stream';
|
||||
box_in.output{output_index}.header.nb_channels = nb_channels;
|
||||
box_in.output{output_index}.header.channel_names = channel_names;
|
||||
box_in.output{output_index}.header.dynamic = dynamic;
|
||||
|
||||
box_in.output{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setFeatureVectorInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Feature Vector input.
|
||||
|
||||
function box_out = OV_setFeatureVectorInputHeader(box_in, input_index, nb_features, labels)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Feature Vector Stream';
|
||||
box_in.inputs{input_index}.header.nb_features = nb_features;
|
||||
box_in.inputs{input_index}.header.labels = labels;
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setFeatureVectorInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Feature Vector input.
|
||||
|
||||
function box_out = OV_setFeatureVectorOutputHeader(box_in, output_index, nb_features, labels)
|
||||
|
||||
box_in.outputs{output_index}.header.type = 'Feature Vector Stream';
|
||||
box_in.outputs{output_index}.header.nb_features = nb_features;
|
||||
box_in.outputs{output_index}.header.labels = labels;
|
||||
|
||||
box_in.outputs{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setSettings.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% This file is meant to be executed prior to any user defined script.
|
||||
% It construct the objects used by the other functions of the toolkit
|
||||
% MEANT TO BE USED BY OPENVIBE
|
||||
|
||||
function box_out = OV_setSettings(box_in, names, types, values)
|
||||
|
||||
box_in.settings = struct('name',names,'type',types,'value',values);
|
||||
box_out = box_in;
|
||||
end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setSignalInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal input.
|
||||
|
||||
function box_out = OV_setSignalInputHeader(box_in, input_index, nb_channel, nb_samples_per_buffer, channel_names, sampling_rate)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Signal Stream';
|
||||
box_in.inputs{input_index}.header.nb_channels = nb_channel;
|
||||
box_in.inputs{input_index}.header.nb_samples_per_buffer = nb_samples_per_buffer;
|
||||
box_in.inputs{input_index}.header.channel_names = channel_names;
|
||||
box_in.inputs{input_index}.header.sampling_rate = sampling_rate;
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setSignalOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function box_out = OV_setSignalOutputHeader(box_in, output_index, nb_channel, nb_samples_per_buffer, channel_names, sampling_rate)
|
||||
|
||||
box_in.outputs{output_index}.header.type = 'Signal Stream';
|
||||
box_in.outputs{output_index}.header.nb_channels = nb_channel;
|
||||
box_in.outputs{output_index}.header.nb_samples_per_buffer = nb_samples_per_buffer;
|
||||
box_in.outputs{output_index}.header.channel_names = channel_names;
|
||||
box_in.outputs{output_index}.header.sampling_rate = sampling_rate;
|
||||
|
||||
box_in.outputs{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setSpectrumHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Spectrum input.
|
||||
|
||||
function box_out = OV_setSpectrumInputHeader(box_in, input_index, nb_channels, channel_names, nb_abscissas, abscissas_names, abscissas, sampling_rate)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Spectrum Stream';
|
||||
box_in.inputs{input_index}.header.nb_channels = nb_channels;
|
||||
box_in.inputs{input_index}.header.channel_names = channel_names;
|
||||
box_in.inputs{input_index}.header.nb_abscissas = nb_abscissas;
|
||||
box_in.inputs{input_index}.header.abscissas_names = abscissas_names;
|
||||
box_in.inputs{input_index}.header.abscissas = abscissas;
|
||||
box_in.inputs{input_index}.header.sampling_rate = sampling_rate;
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setSpectrumOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Spectrum input.
|
||||
|
||||
function box_out = OV_setSpectrumOutputHeader(box_in, output_index, nb_channels, channel_names, nb_abscissas, abscissas_names, abscissas, sampling_rate)
|
||||
|
||||
box_in.outputs{output_index}.header.type = 'Spectrum Stream';
|
||||
box_in.outputs{output_index}.header.nb_channels = nb_channels;
|
||||
box_in.outputs{output_index}.header.channel_names = channel_names;
|
||||
|
||||
box_in.outputs{output_index}.header.nb_abscissas = nb_abscissas;
|
||||
box_in.outputs{output_index}.header.abscissas_names = abscissas_names;
|
||||
box_in.outputs{output_index}.header.abscissas = abscissas;
|
||||
box_in.outputs{output_index}.header.sampling_rate = sampling_rate;
|
||||
|
||||
box_in.outputs{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setChannelLocalizationInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Stimulation input.
|
||||
|
||||
function box_out = OV_setStimulationInputHeader(box_in, input_index)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Stimulation Stream';
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setStimulationOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Stimulation input.
|
||||
|
||||
function box_out = OV_setStimulationOutputHeader(box_in, output_index)
|
||||
|
||||
box_in.outputs{output_index}.header.type = 'Stimulation Stream';
|
||||
|
||||
box_in.outputs{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setChannelLocalizationInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Stimulation input.
|
||||
|
||||
function box_out = OV_setStimulationsInputHeader(box_in, input_index)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Stimulation Stream';
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setStimulationOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a Stimulation input.
|
||||
|
||||
function box_out = OV_setStimulationsOutputHeader(box_in, output_index)
|
||||
|
||||
box_in.outputs{output_index}.header.type = 'Stimulation Stream';
|
||||
|
||||
box_in.outputs{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setStreamedMatrixInputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a streamed Matrix input.
|
||||
|
||||
function box_out = OV_setStreamedMatrixInputHeader(box_in, input_index, nb_dim, dim_sizes, dim_labels)
|
||||
|
||||
box_in.inputs{input_index}.header.type = 'Streamed Matrix Stream';
|
||||
box_in.inputs{input_index}.header.nb_dimensions = nb_dim;
|
||||
box_in.inputs{input_index}.header.dimension_sizes = dim_sizes;
|
||||
box_in.inputs{input_index}.header.dimension_labels = dim_labels;
|
||||
|
||||
box_in.inputs{input_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
% OV_MATLAB toolkit
|
||||
% OV_setStreamedMatrixOutputHeader.m
|
||||
% -------------------------------
|
||||
% Author : Laurent Bonnet (INRIA)
|
||||
% Date : 28/07/2011
|
||||
|
||||
% Set the header information on a signal output.
|
||||
% MEANT TO BE USED IN USER SCRIPT
|
||||
|
||||
function box_out = OV_setStreamedMatrixOutputHeader(box_in, output_index, nb_dim, dim_sizes, dim_labels)
|
||||
|
||||
box_in.outputs{output_index}.header.type = 'Streamed Matrix Stream';
|
||||
box_in.outputs{output_index}.header.nb_dimensions = nb_dim;
|
||||
box_in.outputs{output_index}.header.dimension_sizes = dim_sizes;
|
||||
box_in.outputs{output_index}.header.dimension_labels = dim_labels;
|
||||
|
||||
box_in.outputs{output_index}.buffer = {};
|
||||
|
||||
box_out = box_in;
|
||||
end
|
||||
Reference in New Issue
Block a user