|
ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Inputs and outputs > Laser controllers > Setting up a laser controller > Pulse train file formats Pulse train file formats
In briefANY-maze has the capability of generating pulse trains for laser controllers, based on the contents of a file. This means that rather than a repetitive pulse of a given frequency and duty cycle, you can explicitly tell the laser how long you want the laser to be on for, and how long to turn off for, to the nearest millisecond. This can be used to generate arbitrary sequences of pulse trains and even laser intensities (if your lasers support this feature). For more details of how to use a pulse train file within the ANY-maze software, please see Playing an arbitrary sequence of pulses using an external file. This topic describes the formats of the files that can be used. Creating a pulse train fileA pulse train file is simply a text file, so creating one is easy. First of all, open Windows Explorer and navigate to the folder in which you want to store the file. Them right-click anywhere in the folder and select 'New -> Text Document' from the menu that appears. The file will be created in that folder, and the name of the file will be highlighted (to start with, it will be 'New Text Document.txt'). Type in the name that you want to give the file. You can then edit the file in Windows Notepad by simply double-clicking on the file, and it will open for editing. Alternatively, you can create a file from within Microsoft Excel; simply use the 'New' option to create a 'Blank workbook'. Each of the file formats described below has two or three 'columns', so you just need to enter the data in these columns and then save the data in 'comma-separated' (.csv) format. File formatsThere are three basic file formats that ANY-maze recognizes. It's entirely up to you which one of these you choose; just use whichever one seems easiest to enter the pulse sequence that you need. If you're starting with some data exported from another application (for example, NeuroExplorer) then you'll find that this influences the format you choose.
The file formats described below contain some examples which should allow you to create your own files, but if you have any questions about these file formats, then please contact ANY-maze Support who will be happy to help. DurationsThis file format contains two or three columns, and each line of the file will contain:
The first line of this file defines the file format, and must contain the following text: Duration off, Duration on or Duration off, Duration on, Voltage Note that this text is not case-sensitive, and any spaces are ignored. If you want the laser controller to turn on immediately when the file starts playing, you need to enter 0 for the first 'duration off'. Likewise, if you want a period at the end of the file where the laser is off, then enter 0 for the 'duration on' in the last line of the file. The following simple file will turn the laser on for 1ms, then off for 1ms, then turn it on for 2ms, then off for 2ms, and so on up to 10ms. Duration off, Duration on 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9, 10 10, 0 Note that the first line of the file contains 0 for the 'time off', so the laser will turn on (for 1ms) immediately when the laser controller is activated. At the end of the file, the last line shows that the laser is turned off for 10ms (then on for 0ms, which means that this 0 is ignored). If this file were to be repeated, then the laser would be off for 10ms at the end of the file, before turning on for 1ms as it starts to play again. As with all pulse train files recognised by ANY-maze, you can optionally change the voltage. To do this, just add a value for the voltage at the end of the relevant line. If the voltage is entered as 0, or is not specified, then it will be left as it was when the laser was previously used (i.e. the voltage will not be changed). A simple example of this file format, with voltages, is as follows: Duration off, Duration on, voltage 5, 5, 5.0 5, 5, 2.5 This file will leave the laser off for 5ms, then pulse it on for 5ms at full intensity (5.0V). After turning it off for another 5ms, it will pulse it on for 5ms at half intensity (2.5V). This file would generate a simple pulse of 100Hz, but with the laser intensity alternating between half- and full-voltage. ANY-maze will check the pulse train file when it is loaded, to ensure that the data is valid. When you select the file on the laser controller's settings page, you'll be warned if the values contained in the file are invalid. All durations must be a positive number of milliseconds, and voltages (if specified) must be between 0.02 and 5.0V (or 0, meaning "don't change the voltage"). Pulse times and widthsThis second file format simply lists a number of 'pulse times' at which to pulse the laser, together with the width of each pulse. Pulse times are specified in seconds, and pulse widths in ms. So the columns of the file are:
The first line of this file defines the file format, and must contain the following text: Pulse time, Width or Pulse time, Width, Voltage Note that this text is not case-sensitive, and any spaces are ignored. The following file has been created from the data contained in a file exported from NeuroExplorer. The NeuroExplorer output has created a list of times (after the start of the test) that neural spikes were recorded - these times have been extracted and pasted into Microsoft Excel; pulse widths of 5ms have been added as a second column of data, and the result has been saved as a comma-separated (.csv) file: Pulse time, width, voltage 1.535050, 5 2.401675, 5 3.404325, 5 4.584225, 5 5.031375, 5 5.505950, 5 6.095725, 5 18.112375, 5 This file will pulse the laser on at 1.535 seconds after the laser is activated, for 5ms; then at 2.401 seconds, for 5ms; etc. Note that within ANY-maze, all pulse train files have 1ms resolution, so the extra sub-millisecond data in the above file will just be ignored; this example has been created in a few simple steps from a NeuroExplorer output file, which is why it is specified in more detail than is necessary for ANY-maze. Again, this file format can optionally specify the voltage. If the above file was to gradually increase the voltage of the laser for each pulse, it could be written as follows: Pulse time, width, voltage 1.535050, 5, 3.5 2.401675, 5, 3.7 3.404325, 5, 3.8 4.584225, 5, 4.0 5.031375, 5, 4.2 5.505950, 5, 4.4 6.095725, 5, 4.6 18.112375, 5, 4.8 Note that all voltages specified in these files must be within the 0.02V to 5.0V range allowed for an ANY-maze Optogenetics interface laser; if the file contains voltages outside this range, then playing the pulse file will fail. (Remember that 0.0 is a valid value, and means "don't change the voltage"). If any of the voltages are outside this range, then when you load the file into the laser controller's settings page, you'll be warned that the file is invalid and you won't be allowed to select it. ANY-maze will check the pulse train file when it is loaded, to ensure that the data is valid. When you select the file on the laser controller's settings page, you'll be warned if the values contained in the file are invalid. The pulse times and widths in this file cannot be negative, and the pulses defined cannot overlap. In addition, voltages (if specified) must be between 0.02 and 5.0V, or 0 (meaning "don't change the voltage"). Pulse on/off timesThe final format of file recognized by ANY-maze is similar to the previous format, but rather than defining the pulse width, it defines the time to turn the pulse on, and the time to turn it off. The columns of the file are:
The first line of this file defines the file format, and must contain the following text: Pulse on, Pulse off or Pulse on, Pulse off, Voltage Note that this text is not case-sensitive, and any spaces are ignored. The following file will simply pulse the laser on for 10ms after 1 second; for 20ms after 2 seconds; and so on until 8 seconds have passed: Pulse on, Pulse off 1.0, 1.010 2.0, 2.020 3.0, 3.030 4.0, 4.040 5.0, 5.050 6.0, 6.060 7.0, 7.070 8.0, 8.080 Again, an optional voltage can be specified for each pulse, if required: Pulse on, Pulse off, Voltage 1.0, 1.010, 5.0 2.0, 2.020, 4.5 3.0, 3.030, 4.0 4.0, 4.040, 3.5 5.0, 5.050, 3.0 6.0, 6.060, 2.5 7.0, 7.070, 2.0 8.0, 8.080, 1.5 This simple example will pulse the laser as before, but will reduce the intensity of the laser each time it does it. ANY-maze will check the pulse train file when it is loaded, to ensure that the data is valid. When you select the file on the laser controller's settings page, you'll be warned if the values contained in the file are invalid. The pulse times in this file cannot be negative, and must be consecutive (i.e. all 'pulse off' times must be after the corresponding 'pulse on' time). In addition, voltages (if specified) must be between 0.02 and 5.0V, or 0 (meaning "don't change the voltage").
Note that it's possible to create a set of pulse train data that can be interpreted as more than one of these formats; for this reason, it's important to ensure that the titles on the first line of the file are correct.
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T0245 |