Update MRI or Trigger: Links authored by Fabian Berg's avatar Fabian Berg
...@@ -4,12 +4,12 @@ The following chapter contains functions that can be used to execute experiments ...@@ -4,12 +4,12 @@ The following chapter contains functions that can be used to execute experiments
## initMRIChatPart1 ## initMRIChatPart1
function: mmap = initMRTChatPart1 function: mmap = [initMRTChatPart1](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Tools/initMRIChatPart1.m)
**Description** **Description**
Initialize MRI related functions. To record all triggers successfully initMRIChatPart2 has to be called AFTER initWindow is called! Returns handle to memory mapped file (output). Initialize MRI related functions. To record all triggers successfully [initMRIChatPart2](/MRI-or-trigger#initmrichatpart2) has to be called AFTER [initWindow](/Stimuli-Display#initwindow) is called! Returns handle to memory mapped file (output).
initMRIChatPart1 will start triggerCounter2_MCR9-2.exe automatically. This program periodically sends triggers via the parallel port pin 10 (1 trigger per scan) if the scanner is turned on. The memory mapped file that is created is important for the communication between matlab and triggerCounter2. The program can be stopped by pressing escape. [initMRTChatPart1](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Tools/initMRIChatPart1.m) will start triggerCounter2_MCR9-2.exe automatically. This program periodically sends triggers via the parallel port pin 10 (1 trigger per scan) if the scanner is turned on. The memory mapped file that is created is important for the communication between matlab and triggerCounter2. The program can be stopped by pressing escape.
**Outputs** **Outputs**
~~~ ~~~
...@@ -24,10 +24,10 @@ initMRIChatPart1 will start triggerCounter2_MCR9-2.exe automatically. This progr ...@@ -24,10 +24,10 @@ initMRIChatPart1 will start triggerCounter2_MCR9-2.exe automatically. This progr
## initMRIChatPart2 ## initMRIChatPart2
function: initMRTChatPart2(mmap, scans2Wait) function: [initMRTChatPart2(mmap, scans2Wait)](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Tools/initMRIChatPart2.m)
**Description** **Description**
Initialize MRI functions part 2. Includes waiting for the first trigger. Do not forget to call initWindow first! On the presentation window user information about the process will appear. It is not meant for stimulus presentation in this case. Initialize MRI functions part 2. Includes waiting for the first trigger. Do not forget to call [initWindow](/Stimuli-Display#initwindow) first! On the presentation window user information about the process will appear. It is not meant for stimulus presentation in this case.
**Inputs** **Inputs**
~~~ ~~~
...@@ -37,16 +37,16 @@ Initialize MRI functions part 2. Includes waiting for the first trigger. Do not ...@@ -37,16 +37,16 @@ Initialize MRI functions part 2. Includes waiting for the first trigger. Do not
## sendTriggerMRI ## sendTriggerMRI
function: sendTriggerMRI(mmap, pin, status) function: [sendTriggerMRI(mmap, pin, status)](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/Tools/sendTriggerMRI.m)
**Description** **Description**
Use this function to send single triggers (e.g. for MRI or EEG) to an external device using the parallel port. All IO communications are handled via a memory mapped file that is provided by triggerCounter2 and the initMRI functions. The arguments for turning on and off certain pins is similar to parchat. Use this function to send single triggers (e.g. for MRI or EEG) to an external device using the parallel port. All IO communications are handled via a memory mapped file that is provided by triggerCounter2 and the [initMRI](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/wikis/MRI-or-Trigger) functions. The arguments for turning on and off certain pins is similar to [parchat](/MRI-or-trigger#parchat).
**Inputs** **Inputs**
~~~ ~~~
mmap memory mapped file, enter output from initMRIChatPart1 mmap memory mapped file, enter output from initMRIChatPart1
pin pin number for sending trigger pin pin number for sending trigger
status turn on/off pin, can be either ‘1’ (on) or ‘0’ (off) status turn on/off pin, can be either '1' (on) or '0' (off)
~~~ ~~~
## parChat ## parChat
...@@ -54,9 +54,9 @@ Use this function to send single triggers (e.g. for MRI or EEG) to an external d ...@@ -54,9 +54,9 @@ Use this function to send single triggers (e.g. for MRI or EEG) to an external d
function: parchat(pin,status) function: parchat(pin,status)
**Description** **Description**
This function opens an interface with a parallel port using InpOutx64. This is a 64bit mex files that works on 64 bit Windows only! A parallel port is mandatory for the execution of this function. Call of the function is not possible when the parallel port is occupied by continuous requests, for example when using triggerCounter2_MCR9-2.exe. Use sendTriggerMRI in this case. This function opens an interface with a parallel port using InpOutx64. This is a [64bit mex files](https://gitlab.ruhr-uni-bochum.de/ikn/OTBR/-/blob/master/IO/parchat.mexw64) that works on 64 bit Windows only! A parallel port is mandatory for the execution of this function. Call of the function is not possible when the parallel port is occupied by continuous requests, for example when using triggerCounter2_MCR9-2.exe. Use [sendTriggerMRI](/MRI-or-trigger#sendtriggermri) in this case.
The function parChat can activate or deactivate pin 2-9 if it is called with a status condition or it can listen to pin 10-15 if it is called without a status condition. In contrast to parChatWord this is only possible for one pin at a time. A table explaining all possible combinations can be found in chapter 2.4. Event-codes. The function parChat can activate or deactivate pin 2-9 if it is called with a status condition or it can listen to pin 10-15 if it is called without a status condition. In contrast to [parChatWord](/MRI-or-trigger#parchatword) this is only possible for one pin at a time. A table explaining all possible combinations can be found in [chapter 2.8. Event-codes](/How-tos#event-codes).
**Inputs** **Inputs**
~~~ ~~~
...@@ -65,7 +65,7 @@ The function parChat can activate or deactivate pin 2-9 if it is called with a s ...@@ -65,7 +65,7 @@ The function parChat can activate or deactivate pin 2-9 if it is called with a s
**Inputs-optional** **Inputs-optional**
~~~ ~~~
varargin status turn on/off pin, can be either ‘1’ (on) or ‘0’ (off) varargin status turn on/off pin, can be either '1' (on) or '0' (off)
~~~ ~~~
## parChatWord ## parChatWord
...@@ -73,12 +73,12 @@ The function parChat can activate or deactivate pin 2-9 if it is called with a s ...@@ -73,12 +73,12 @@ The function parChat can activate or deactivate pin 2-9 if it is called with a s
function: parchatWord(repbin) function: parchatWord(repbin)
**Description** **Description**
Similar to parChat this function opens an interface with a parallel port and is able to activate or deactivate the data ports (pin 2-9). In contrast to the above parChatWord can use all 8 bits of the data port at the same time, therefore usage of the function can be a bit more challenging. Similar to [parChat](/MRI-or-trigger#parchat) this function opens an interface with a parallel port and is able to activate or deactivate the data ports (pin 2-9). In contrast to the above parChatWord can use all 8 bits of the data port at the same time, therefore usage of the function can be a bit more challenging.
The input variable needs to be a decimal number which translates into an array representing a binary number. This array includes commands for pin 2-9 of the parallel port. Use the matlab internal functions dec2bin and bin2dec to find out which number you need to use as input for this function. Further explanation and examples can be found in chapter 2.4. Event-codes. The input variable needs to be a decimal number which translates into an array representing a binary number. This array includes commands for pin 2-9 of the parallel port. Use the matlab internal functions [dec2bin](https://de.mathworks.com/help/matlab/ref/dec2bin.html) and [bin2dec](https://de.mathworks.com/help/matlab/ref/bin2dec.html?s_tid=doc_ta) to find out which number you need to use as input for this function. Further explanation and examples can be found in [chapter 2.8. Event-codes](/How-tos#event-codes).
**Inputs** **Inputs**
~~~ ~~~
repbin decimal number for character array representing binary number repbin decimal number for character array representing binary number
using ‘0’ as input argument will deactivate all triggers using '0' as input argument will deactivate all triggers
~~~ ~~~
\ No newline at end of file