|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
## What is the panel?
|
|
|
|
The user panel is a novel tool incorporated in the new OTBR Toolbox. It allows you to monitor how your animal is behaving during your experiments from the comfort of your office. Compared to the webcam access that was available before, the panel now offers the possibility to see how the animal is performing, how far the session has progressed, what the pigeon is seeing and a lot more information.
|
|
|
|
|
|
|
|
The following chapters will guide you through what the panel can do, what you need to add to your Matlab paradigms, how to run it on your computer and how to interact with the panel.
|
|
|
|
|
|
|
|
## What does the panel look like?
|
|
|
|
The following is an example of what the panel can show you when a pigeon is performing a paradigm.
|
|
|
|
|
|
|
|
![image](uploads/7ad623819172c94d7cfaaeca1cbb96c5/image.png)
|
|
|
|
|
|
|
|
The panel allows the incorporation of various subpanels that display different kinds of information. The following will be a short description of what each panel can do:
|
|
|
|
|
|
|
|
**Camera subpanel**
|
|
|
|
The most obvious is the camera subpanel. This is the IP camera which has been available before.
|
|
|
|
|
|
|
|
**Performance subpanel**
|
|
|
|
For monitoring how the animal is performing, this is probably the most interesting panel. It lists different parameters that are of interest for the current session, including:
|
|
|
|
~~~
|
|
|
|
maxTrls: How many trials the session encompasses
|
|
|
|
dur: The current duration of the session
|
|
|
|
trialNr: The current trial number
|
|
|
|
%-corr: The percentage of correct trials during the session
|
|
|
|
%-incorr: The percentage of incorrect trials during the session
|
|
|
|
%-noRsp: The percentage of responses/no responses in this session
|
|
|
|
~~~
|
|
|
|
|
|
|
|
This information delivers a precise overview of how the pigeon is performing and how far in the session it is. This panel also has a graph displaying the performance over the trial.
|
|
|
|
|
|
|
|
**Info subpanel**
|
|
|
|
This panel allows the user to send three lines of custom text from the paradigm to the panel. This can be any information that you deem important. As an example, this could be info about which paradigm is running in line one (‘This is autoshaping’), what phase of the paradigm is currently running (‘Feeding’) in line two, and which animal is in the box (‘636’) in line three. This is however totally customizable.
|
|
|
|
|
|
|
|
The info panel also includes three buttons labeled ‘Start panel’ (starts the panel), ‘Remove panel’ (closes the panel), and ‘Reset panel’ (resets the panel).
|
|
|
|
|
|
|
|
**Paradigm panel**
|
|
|
|
In this panel you are able to see what is displayed on the box monitor, an animals view, so to speak.
|
|
|
|
|
|
|
|
## How to incorporate the panel feature into your paradigms?
|
|
|
|
It is fairly easy to install the panel feature, however there are certain requirements and some changes needed in the paradigms to take full advantage of the panel.
|
|
|
|
|
|
|
|
**Requirements**
|
|
|
|
The client panel is only able to run on Windows 64-bit systems. This is due to the new OTBR Toolbox, which we will talk about in the next passages. Most of our computers are running on 64-bit systems already, however if your computer is still running a 32-bit version an update is necessary.
|
|
|
|
|
|
|
|
For MATLAB to be able to access the IP camera, it needs a camera support package. Type ipcam or webcam (depending on the camera type you wish to use) into the MATLAB command prompt and follow the steps on the screen to get the support package.
|
|
|
|
|
|
|
|
To be able to use the paradigm panel, you must have the relevant paradigm on the computer you are using the panel on. In the paradigm directory there must be a \Stimuli folder (i.e. paradigm is located in C:\experiment\example, the stimuli pictures must be in C:\experiment\example\Stimuli). This folder must contain all stimuli and only stimuli.
|
|
|
|
|
|
|
|
**Converting to the OTBR Toolbox**
|
|
|
|
The OTBR Toolbox is a newer version of the Biopsychology Toolbox, which allows for more advanced applications. Fortunately, most basic features are identical and therefore do not need changing. The most relevant changes affect _start.m_ and _mySetup.m_.
|
|
|
|
|
|
|
|
_start.m_ is replaced by [initOTBR.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/initOTBR.m). As this a 1-to-1 replacement, you will simply need to replace start; with initOTBR; in your code. You will not need to make changes within [initOTBR.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/initOTBR.m).
|
|
|
|
|
|
|
|
Instead of _mySetup.m_, in this new toolbox you will find [myHardwareSetup.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/myHardwareSetup.m) and [myParadigmSetup.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/myParadigmSetup.m). In these two scripts, you will need to make changes specific to your box (such as IO-Box, inputs and outputs in [myHardwareSetup.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/myHardwareSetup.m)) and paradigm (such as stimuli position and size in [myParadigmSetup.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/myParadigmSetup.m)). You should be able to simply copy the relevant parameters from _mySetup.m_. Any problems regarding the conversion should appear when running the program with the OTBR Toolbox for the first time and can then be fixed.
|
|
|
|
|
|
|
|
**What to add to your paradigm**
|
|
|
|
There are two main functions that you will need to add to your code. These are [connect2ClientPanel](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/connect2ClientPanel.m) and [send2ClientPanel](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/send2ClientPanel.m) (scripts: [connect2ClientPanel.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/connect2ClientPanel.m) and [send2ClientPanel.m](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/send2ClientPanel.m)).
|
|
|
|
|
|
|
|
**connect2ClientPanel**
|
|
|
|
[connect2ClientPanel](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/connect2ClientPanel.m) is used to establish a connection between the local computer running the experiment and the remote computer which is used for monitoring via the network. This function requires two inputs
|
|
|
|
~~~matlab
|
|
|
|
connect2ClientPanel(rmtIp, lclIp);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
with _rmtIp_ being the IP address of the remote computer (often your office computer) and _lclIp_ being the IP address of the experimental computer. [connect2ClientPanel](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/connect2ClientPanel.m) only needs to be called once in the beginning of the program and can be added at any point after [initOTBR](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/initOTBR.m), but before any other panel commands. Both IPs need to entered as strings. To identify which is which, it is a good idea to define variables for the IPs as in the following example:
|
|
|
|
~~~matlab
|
|
|
|
lclIP = '192.168.1.231';
|
|
|
|
rmtIP = '192.168.1.188';
|
|
|
|
connect2ClientPanel(rmtIP,lclIP);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
**send2ClientPanel**
|
|
|
|
[send2ClientPanel](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Network/clientPanel/send2ClientPanel.m) needs to be added at any point in the paradigm where information should be sent to the panel. This function accept various inputs which affect different parts of the panel. These include:
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('infotext1','Your text here');
|
|
|
|
send2ClientPanel('infotext2','Your text here');
|
|
|
|
send2ClientPanel('infotext3','Your text here');
|
|
|
|
~~~
|
|
|
|
|
|
|
|
These inputs allow for 'Your text here' to be displayed in the info box in lines 1, 2 or 3. You can enter any information that you deem relevant in form of a string, or as a variable. Add this anywhere within the paradigm where you want your info.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('showStimuli', stimulus, stimulusPosition);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
This function shows stimuli in the paradigm window of the panel. As with the [showStimuli()](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Screen/showStimuli.m) function in Matlab you need to enter the stimulus and the position for it to be displayed. Use this every time a stimulus is presented. To display multiple stimuli enter variables as vectors.
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('showStimuli', [stim1, stim2], [5, 6]);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
To make a stimulus disappear use
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('showStimuli', [], []);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
The following inputs will affect the performance panel:
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('maxTrls', totalTrialNumber);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
To see the maximum number of trials enter your variable that specifies the total number of trials for _totalTrialNumber_. It is recommended to add this at the beginning of each trial.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('trlnr',currentTrialNumber);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
To see the current trial number you can usually enter the variable that is specified for the loop (e.g. _for i=1:trial.num_, _i_ being the variable that gives you the trial number) instead of _currentTrialNumber_. If you are using a paradigm with more than one loop, you may need to define a separate variable for this. It is recommended to add this at the beginning of each trial.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('duration', toc);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
This gives you the time that has elapsed so far. For this to work you will need to add a tic; right before the experiment starts (before the loop). Add this wherever you want in the paradigm
|
|
|
|
~~~matlab
|
|
|
|
send2ClientPanel('trlCorr', ResultvectorCorrect);
|
|
|
|
send2ClientPanel('trlInCorr', ResultvectorIncorrect);
|
|
|
|
send2ClientPanel('trlNoRsp', ResultvectorResponse);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
To display the percentages of correct trials, a vector must be entered listing whether a trial was correct (1) or not (0). You can for example do this as follows
|
|
|
|
~~~matlab
|
|
|
|
ResultvectorCorrect = logical([ResultvectorCorrect out(i).goodKey]);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
With out(i) being the [keybuffer](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/IO/keyBuffer.m) output. This line of code should be added at the end of your loop. For the example above to work ResultvectorCorrect would need to be defined at the beginning with
|
|
|
|
~~~matlab
|
|
|
|
ResultvectorCorrect = [];
|
|
|
|
~~~
|
|
|
|
|
|
|
|
This can be also be applied for incorrect and response values.
|
|
|
|
|
|
|
|
|
|
|
|
## What do you need to run on your computer?
|
|
|
|
|
|
|
|
To be able to fully use the panel on your computer you need the OTBR toolbox and the relevant paradigms as stated above. To load the panel you need to run a short program, an example of which is shown below.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
initOTBR;
|
|
|
|
clientList.client.name='test';
|
|
|
|
clientList.client.remoteIP='192.168.1.231';
|
|
|
|
clientList.client.localIP='192.168.1.188';
|
|
|
|
clientList.camera.device='http://10.147.255.102/mjpg/video.mjpg';
|
|
|
|
clientList.camera.userName='admin';
|
|
|
|
clientList.camera.password='1234';
|
|
|
|
subPanels= {'performance', 'paradigm','camera'};
|
|
|
|
[fig, cPnl] = openCPanelFig(clientList, subPanels);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
We will now have a quick look at the different components.
|
|
|
|
~~~matlab
|
|
|
|
initOTBR;
|
|
|
|
~~~
|
|
|
|
|
|
|
|
We use this to initialize the OTBR toolbox. (see [Chapter 3.3](/Initialization#initotbr) for further information)
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
clientList.client.name='test';
|
|
|
|
clientList.client.remoteIP='192.168.1.231';
|
|
|
|
clientList.client.localIP='192.168.1.188';
|
|
|
|
~~~
|
|
|
|
|
|
|
|
These lines of code specify which box you want to connect to. With name you can give the panel a name so that you know which box you are looking at. For remoteIP you need to enter the IP address of the experimental computer and for localIP you need to enter the IP address of your computer. Be aware that this is the other way around compared to the IPs you specified in your paradigm.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
clientList.camera.device='http://10.147.255.102/mjpg/video.mjpg';
|
|
|
|
clientList.camera.userName='admin';
|
|
|
|
clientList.camera.password='1234';
|
|
|
|
~~~
|
|
|
|
|
|
|
|
To access the camera you need to specify the IP address for the camera, the username and the password just as before. Name and password are often admin and 1234, but may vary for other cameras.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
subPanels= {'performance', 'paradigm','camera'};
|
|
|
|
~~~
|
|
|
|
|
|
|
|
With _subPanels_ you can specify which subpanels you want to see. You can enter 'performance', 'paradigm', 'camera', 'lancontrol', 'lclcontrol'. The Info panel is there by default and does not need to be specified separately.
|
|
|
|
|
|
|
|
~~~matlab
|
|
|
|
[fig, cPnl] = openCPanelFig(clientList, subPanels);
|
|
|
|
~~~
|
|
|
|
|
|
|
|
This opens the figure for the panel and uses the information entered above to connect to stated box and to show the subpanels you have chosen. You will not need to change anything here.
|
|
|
|
|
|
|
|
After running this short script a Matlab figure will appear that looks similar to the example below. This is what the panel looks like in its ‘naïve’ state.
|
|
|
|
|
|
|
|
![image](uploads/286a354db3d62eee8dde331d35ed6d77/image.png)
|
|
|
|
|
|
|
|
In this state the panel will not show any information yet and you need to start the panel by clicking the ‘Start panel’ button in the Info box. Now the camera will show you the live feed and the performance panel will start updating. To be able to see the paradigm, you will need to click on the ‘Select paradigm’ button in the Paradigm box. This will open a window where you can choose the Matlab file for your paradigm.
|
|
|
|
|
|
|
|
![image](uploads/d843e926cb136186cc83defd71461a24/image.png)
|
|
|
|
|
|
|
|
Once you have chosen a paradigm a dialog box will open where you can enter your subjects name.
|
|
|
|
|
|
|
|
![image](uploads/17db8f9f19b4ace0ace80231a555279e/image.png)
|
|
|
|
|
|
|
|
When you have entered a name and pressed OK the Paradigm box of the panel should turn black and is now ready to show stimuli.
|
|
|
|
|
|
|
|
|
|
|
|
**Congratulations, your panel should now be fully functional!**:tada: |
|
|
|
\ No newline at end of file |