Difference between revisions of "Manuals & Downloads / Repository"

From Neuroelectric's Wiki
Jump to: navigation, search
(Data Analysis)
 
(121 intermediate revisions by 3 users not shown)
Line 1: Line 1:
In this page you can find links to our manuals and to a code repository. Many of these links are equivalent to those in our [http://www.neuroelectrics.com/support/download '''Download Area'''] section in the Neuroelectrics website.  
+
In this page you can find links to our manuals and to a code repository. Many of these links are equivalent to those in our [http://www.neuroelectrics.com/documentation/ '''Manuals Area'''] and [http://www.neuroelectrics.com/downloads/'''Software Area'''] section in the Neuroelectrics website.  
  
Neuroelectrics' systems include [http://www.neuroelectrics.com/enobio '''Enobio'''] (EEG) and [http://www.neuroelectrics.com/starstim '''StarStim'''] (EEG/tCS) class devices as well as our universal software controller - [http://www.neuroelectrics.com/enobio/software '''Neuroelectrics Instrument Controller (NIC)''']. Manuals and other downloads are available for both.
+
[[File:Website_overview.PNG|800px]]
  
= Neuroelectrics Download Area for Manuals and software =
+
Neuroelectrics' systems include [http://www.neuroelectrics.com/products/enobio/ '''Enobio'''] (EEG, [http://www.neuroelectrics.com/products/starstim/ '''StarStim'''] (EEG/tCS) and [https://www.neuroelectrics.com/products/starstim/starstim-tcs/ '''Starstim tCS'''] (tCs) class devices as well as our universal software controller - [http://www.neuroelectrics.com/products/software/ '''Neuroelectrics Instrument Controller (NIC)'''].
 +
 
 +
              [[File:Enobio_starstim_stcs.png|600px]]
  
Please visit [http://www.neuroelectrics.com/support/download '''Download Area''']  for an updated list of software updates (NIC, NIC Offline, API, etc), as well as user manuals.
 
  
 
= Matlab code =
 
= Matlab code =
  
 +
MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment. A proprietary programming language developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, C#, Java, Fortran and Python.
 +
 +
Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing abilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.
  
 
== Data Analysis ==
 
== Data Analysis ==
 +
 +
For the Data Analyisis of Neuroelectrics data (EEG data) we provide some programming codes.
  
 
You can find  [[media:NE_Viewer_plusSampleData.zip | '''here''' ]] a zip file containing the following:
 
You can find  [[media:NE_Viewer_plusSampleData.zip | '''here''' ]] a zip file containing the following:
  - NE_Viewer.m, a Matlab function to read and plot NE files, together with 
+
  - NE_Viewer.m, a Matlab demo function to read and plot NE files
  - some data in .''easy'' format and
+
  - some EEG data in .''easy'' format (data format recorded with Neuroelectrics devices)
  - a folder with the figures NE_Viewer.m generates with this data.
+
  - a folder with the figures that NE_Viewer.m generates with this data
  
 
The data and code are provided as examples of how to use Matlab to read and plot data.
 
The data and code are provided as examples of how to use Matlab to read and plot data.
  
The call used to generate the plots in the folder is
+
Please see the [[Data_Processing_with_Matlab| '''Data Processing with Matlab''' ]] section for more information.
  
>> NE_Viewer('20130925192801_PatientTMS.easy',999,500,{'Fp1','Fp2','F3','F4','C3','C4','P3','Cz'});
+
== MatNIC device controller ==
 +
[http://www.neuroelectrics.com/products/software/matnic-remote-stimulation-client/ '''MatNIC'''] is a set of Matlab functions that allows the user to control [http://www.neuroelectrics.com/products/software/nic2/ '''NIC'''] remotely and, in turn, the device that is connected to it (StarStim or Enobio class). MatNIC provides control of the main functions of NIC, such as streaming of EEG data and management of neurostimulation session. This gives the user full remote, programmatic control over NE devices such as Enobio or StarStim from a Matlab environment. These functions allow remotely starting and stopping the EEG streaming, loading a stimulation template, changing stimulation parameters while stimulation is ongoing, starting and stopping the stimulation protocol (when using a StarStim device).
  
The 999 mean "do average referencing" and the 500 is the sampling rate in S/s. The rest are electrode labels (the data has been collected using a StarStim 8 channels system).
+
The MatNIC zip file contains the following:
 
 
Here is the header of NE_Viewer:
 
  
function [NEdata NEdataRefFilPack]= ...
+
*Free MatNIC to control remotely the NIC software:
                      NE_Viewer(filepath, ref, fs, LabelsElectrodes,band,T)
 
% NE_Viewer(filepath) reads Enobio/StarStim (3G, released 2012) data in 
 
% ASCII (.txt or ".easy") or EDF format, and plots parts of it together
 
% with its PSD and spectrogram.
 
%
 
% This function is provided as is as an example on how to work with NE instrument
 
% data.
 
%
 
% INPUTS:
 
% Enobio/StarStim (8 or 20 or 32 Ch) data file path (mandatory) and other optional
 
% entries: "ref" the optional reference channel (use 0 for none, 999 for
 
% an all electrode average), "fs" the sampling rate in S/s,
 
% "LabelsElectrodes" a structure containing channel names, and "band" a
 
% 2-element array with the low and high filtering frequency, e.g.,
 
% band=[1 40], in Hz. Finally, "T" is an arracy specifiying initital and
 
% final time to analyze (in seconds), e.g., T=[10 130].
 
%
 
% OUTPUTS:
 
% Returns the original, raw data pack, NEdata, as a Matlab variable.
 
% preserving the units (e.g., nV, ms). It also returnes NEdataRefFilPack,
 
% the processed (referenced, detreneded, filtered) data (in uV). The time
 
% stamp (in seconds from start of the take) is provided in the last column.
 
%
 
% SIDE EFFECTS: creation of "figures" directory if it does not exist,
 
%              creation of data plot figures of all Enobio channels, etc.
 
%
 
%      out = NE_Viewer(filepath) plots the data in the filepath
 
%      (filepath includes path relative to the Matlab current working
 
%      directory of full absolute path), its PSD and spectrogram for each channel,
 
%      etc., for 8 channels. As default it assumes a 500 Samples/s
 
%      sampling rate, and does not reference the data to any other
 
%      channel.  The code puts figures in a directory under the working
 
%      directory.
 
%     
 
%      NE_Viewer(filepath, ref) references the data to a chosen channel
 
%      (ref should be a Channel number from 1 to 8 (or 20 for Enobio20),
 
%      or zero to force no reference - the default). A reference = 999
 
%      means the average of all electrodes is used as reference.
 
%
 
%      In addition, using the call NE_View(filepath, ref, fs) allows
 
%      for changing the sampling rate fs in Samples/s.
 
%     
 
%      Use a structure with LabelsElectrodes such as
 
%        >> LabelsElectrodes={'Ch1','Ch2','Ch3','Ch4','Ch5','Ch6','Ch7','Ch8'}
 
%      with
 
%        >> NE_View(filepath, ref, fs, LabelsElectrodes)
 
%      to add LabelsElectrodes to channel IDs in plots.
 
%
 
%
 
% EXAMPLE: assuming the data is in a folder called "data",
 
%          NE_Viewer('./data/EC.txt')  % uses all defaults
 
%          NE_Viewer('./data/EC.txt',1)    % spedifies reference channel
 
%          NE_Viewer('./data/EC.txt',1,500) % specifies Sampling rate
 
%
 
%          To specify channel LabelsElectrodes
 
%          NE_Viewer('./data/EC.txt',1,500, ...
 
%                    {'Fp1','Fp2','P3','P4','O1','O1','T7','Pz'} )
 
%
 
%          To specifiy a filter band other than the default:
 
%          NE_Viewer('data/StarStim/20120728085042_TBtACS10Hz1mA.txt',0, ...
 
%                                                        [],[],[1 60]);
 
%
 
%    As another example,
 
%         
 
%      >> [NEdata NEdataRefFilPack]=NE_Viewer('data/Enobio8.txt');
 
%  and then plot data vs. time
 
%      >> figure; plot(NEdataRefFilPack(:,9), NEdataRefFilPack(:,1));
 
%
 
% ABOUT THE NE ASCII DATA FORMAT (July 2012):
 
%      NE ASCII files contain one line per time sample. Each line contains
 
%      first the EEG data (8 or 20 channels, depending on the device, with
 
%      units in nV), followed by  three acceleration channels (aX,aY,aZ
 
%      in mm/s^2- millimeters per second squared), an *optional* external
 
%      input channel, a trigger flag (int32) and, finally,
 
%      a timestamp in Unix time (ms from Jan 1 1970):
 
%
 
% Ch1(nV) ... Ch8or20(nV) aX(mg) aY(mg) aZ(mg) AddSensor Flags(uint32) TimeStamp (ms)
 
 
% Therefore Enobio8/StarStim will have a minimum of 8+2 (10) columns, or 8+3=11 if no
 
%  accelerometer or >= 8+4 (with accelerometer). In summary:
 
%
 
%  Enobio8/20
 
%        10 Columns: no AddSensor, no accelerometer data:
 
%        11 Comumns: no accelerometer, but there is AddSensor
 
%        13 Columns: there is accelerometer, but no Addsensor
 
%        14 Comumns: there is accelerometer, AddSensor.
 
%
 
%  Enobio 20 will have >= 22 and >=24 columns if acc. data present:
 
%        22 Columns: no AddSensor, no accelerometer
 
%        23 Comumns: no accelerometer, but there is AddSensor
 
%        25 Columns: there is accelerometer, no AddSensor
 
%        26 Comumns: there is accelerometer, AddSensor.
 
%
 
%  Enobio 32 will have >=34 adn >=36 if acc data is present
 
%        34 Columns: no AddSensor, no accelerometer
 
%        35 Comumns: no accelerometer, but there is AddSensor
 
%        37 Columns: there is accelerometer, no AddSensor
 
%        38 Comumns: there is accelerometer, AddSensor.
 
%
 
%  Author(s): G.R. - Neuroelectrics Barcelona SL
 
%  Copyright 2011-13 Neuroelectrics Barcelona SL
 
%  $Revision: 0.1 $  $Date: 2011/11/26 $
 
%  $Revision: 0.2 $  $Date: 2012/07/16 $
 
%  $Revision: 0.3 $  $Date: 2012/11/15 $
 
%  $Revision: 0.4 $  $Date: 2013/01/11 $
 
%  $Revision: 1.0 $  $Date: 2013/01/15 $
 
%  $Revision: 1.1 $  $Date: 2013/01/15 $
 
 
%  References:
 
%    [1] Enobio users guide. http://neuroelectrics.com
 
  
== MatNIC device controller ==
+
- The MatNIC user manual (an explanation on how to use the Matlab functions to remotely control NIC and examples)
MatNIC is a set of Matlab functions that allow remotely controlling [http://www.neuroelectrics.com/enobio/software '''NIC''']. These functions allow remotely starting and stopping the EEG streaming, loading a stimulation template and starting and stopping the stimulation protocol (when using a StarStim device).
+
- MatNIC, a folder with all the Matlab functions to remotely control NIC
 +
For more information, [https://www.neuroelectrics.com/support/ '''contact us'''].
  
The MatNIC zip file contains the following:
 
- The MatNIC manual (also available in our [http://www.neuroelectrics.com/support/download  '''Downloads Area''']), an explanation on how to use the Matlab functions to remotely control NIC and
 
- RemoteStimulatioClient, a folder with all the Matlab functions for remotely controlling NIC, and an example on how to use them.
 
  
To run the example please make the following call:
+
*Special MatNIC to perform online stimulation changes:
>> ret = RemoteStimulationClient (templateName, '127.0.0.1', 1235)
 
  
where templaName is set with a name of an already defined stimulation template NIC, then the host where NIC is running (in the example above we use the localhost IP, so NIC is running in the same computer) and finally the port 1235 which is where the NIC server runs.
+
- The MatNIC user manual (an explanation on how to use the Matlab functions to remotely control NIC and examples)
 +
- MatNIC, a folder with all the Matlab functions to remotely control NIC
  
Here is the header of the example client code:
+
For more information, [https://www.neuroelectrics.com/get-a-quote/?add=84      '''contact us for a quotation'''].
  
function [ret] = RemoteStimulationClient (templateName, host, port)
+
See the [[MatNIC_Matlab_Toolkit|'''MatNIC section''']]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% RemoteStimulationClient
 
%
 
% This function implements a client to connect to the NIC Remote
 
% Stimulation Server. The server is running on the machine where the NIC
 
% application runs on the port 1235.
 
%
 
% The NIC Remote Server waits for the client to send the name of the
 
% template that the client wants to use. If the NIC user accepts the
 
% remote control session, the template is loaded and the client is
 
% informed when the system is ready to start the stimulation.
 
%
 
% The client then might send the code to start the stimulation or the one
 
% to abort it. The abort command might be sent in any moment of the
 
% stimulation session. If the stimulation session is aborted locally from
 
% the NIC GUI the connection is automatically closed so the client needs
 
% to connect, send the template and wait again for the permission. When
 
% the stimulation script execution is finished the system prepares itself
 
% to start again a new stimulation so the code informing about that is
 
% received.
 
%
 
% The client might also send commands to start and stop receiving the EEG
 
% streaming. The data is received through a separate server on the port
 
% 1234. The 8/20 channel samples are sent in 4 bytes in two's complement.
 
% The MSB byte is sent first.
 
%
 
% The following are the functions to connect, send the commands to the
 
% server and read the status the server sends:
 
% - NICRemoteStimulationServerConnect
 
% - NICRemoteStimulationServerReadStatus
 
% - NICRemoteStimulationServerLoadTemplate
 
% - NICRemoteStimulationServerStartStimulation
 
% - NICRemoteStimulationServerAbortStimulation
 
% - NICRemoteStimulationServerStartEEG
 
% - NICRemoteStimulationServerStopEEG
 
%
 
% The following are the status that the server might send to the client
 
% and can be read with the NICRemoteStimulationServerReadStatus function:
 
%
 
% STATUS              |  TYPE        |      CODE
 
% -------------------------------------------------------
 
% EEG streaming is ON  |  Byte        |      0xF2
 
% -------------------------------------------------------
 
% EEG streaming is OFF |  Byte        |      0xF3
 
% -------------------------------------------------------
 
% Template not loaded  |  Byte        |      0xF8
 
% -------------------------------------------------------
 
% Template loaded      |  Byte        |      0xF9
 
% -------------------------------------------------------
 
% Stimulation is ready |  Byte        |      0xFC
 
% to be started        |              |
 
% -------------------------------------------------------
 
% Stimulation is ON    |  Byte        |      0xFD
 
% -------------------------------------------------------
 
% Stimulation is OFF  |  Byte        |      0xFE
 
% -------------------------------------------------------
 
%
 
% Input:
 
% templateName: Name of the template to be loaded on NIC.
 
% host: Name or IP of the host where NIC is running.
 
% port: Port number where the NIC server runs.
 
%
 
% Output:
 
% ret: Zero or positive number if the function completes successfully. A
 
% negative number otherwise:
 
% -1: The connection to the host and port number did not succeed.
 
% -2: Error writing template name.
 
% -3: Error reading from server.
 
% -4: Template not loaded.
 
% -5: Error writing command to the server.
 
%
 
% Author: Javier Acedo (javier.acedo@starlab.es)
 
% Company: Neuroelectrics
 
% Created: 16 Jan 2013
 
% Known issues: None
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 

Latest revision as of 12:52, 11 June 2018

In this page you can find links to our manuals and to a code repository. Many of these links are equivalent to those in our Manuals Area and Software Area section in the Neuroelectrics website.

Website overview.PNG

Neuroelectrics' systems include Enobio (EEG, StarStim (EEG/tCS) and Starstim tCS (tCs) class devices as well as our universal software controller - Neuroelectrics Instrument Controller (NIC).

              Enobio starstim stcs.png


Matlab code

MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment. A proprietary programming language developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, C#, Java, Fortran and Python.

Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing abilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.

Data Analysis

For the Data Analyisis of Neuroelectrics data (EEG data) we provide some programming codes.

You can find here a zip file containing the following:

- NE_Viewer.m, a Matlab demo function to read and plot NE files
- some EEG data in .easy format (data format recorded with Neuroelectrics devices)
- a folder with the figures that NE_Viewer.m generates with this data

The data and code are provided as examples of how to use Matlab to read and plot data.

Please see the Data Processing with Matlab section for more information.

MatNIC device controller

MatNIC is a set of Matlab functions that allows the user to control NIC remotely and, in turn, the device that is connected to it (StarStim or Enobio class). MatNIC provides control of the main functions of NIC, such as streaming of EEG data and management of neurostimulation session. This gives the user full remote, programmatic control over NE devices such as Enobio or StarStim from a Matlab environment. These functions allow remotely starting and stopping the EEG streaming, loading a stimulation template, changing stimulation parameters while stimulation is ongoing, starting and stopping the stimulation protocol (when using a StarStim device).

The MatNIC zip file contains the following:

  • Free MatNIC to control remotely the NIC software:
- The MatNIC user manual (an explanation on how to use the Matlab functions to remotely control NIC and examples)
- MatNIC, a folder with all the Matlab functions to remotely control NIC

For more information, contact us.


  • Special MatNIC to perform online stimulation changes:
- The MatNIC user manual (an explanation on how to use the Matlab functions to remotely control NIC and examples)
- MatNIC, a folder with all the Matlab functions to remotely control NIC

For more information, contact us for a quotation.

See the MatNIC section