|
ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Inputs and outputs > Analogue outputs > Setting up an analogue output > Specifying what the animal's position should be output relative to Specifying what the animal's position should be output relative to
In briefIf you choose to set an analogue output to output the animal's X or Y position, then you will also need to specify what the voltage should be relative to: the size of the apparatus, or the size of the video picture. DetailsThese options are easiest understood through an example. Imagine you are tracking animals in the video picture shown in figure 1, below.
Figure 1. A 640x480 pixel video picture (the blue outline) with a 40cm x 40cm open field in it (the green shaded area).
Here, the apparatus is 40cm x 40cm and the picture showing it is 640x480 pixels. Now we want to create an analogue output which will track the animal's X position within the apparatus, so what voltage should actually be output? Well, the answer depends: If you choose to output the voltage relative to the size of the apparatus, then ANY-maze will output the minimum voltage when the animal is on the far left of the apparatus and the maximum voltage when it is on the far right. As the animal moves left to right, so the voltage will increase linearly, in direct proportion to how far across the apparatus it is. For example, if the analogue output's range was 0V - 4.095V, and the animal was 10cm from the left edge of the apparatus in figure 1, then the output would be 1.024V. The same thing applies if the output is tracking the animal's Y position rather than X, the only difference is that the minimum voltage is output when the animal is at the bottom edge of the apparatus (closest to the bottom of the screen) and the maximum is output when it is at the top edge. The other option is to output the voltage relative to the size of the video picture. This is very similar to the previous option, but the voltage range is spread across the image's width, rather than the apparatus width. Note, however, that the mid-point voltage is still output when the animal is at the centre of the apparatus. For example, with the animal 10cm from the left edge of the apparatus in figure 1, we would have the voltage range of 0-4.095V spread across 640 pixels, so each pixel would equate to a voltage step of 0.0064V. The centre of the apparatus would be a voltage of 2.048V. A position 10cm from the left edge of the apparatus would be around 60 pixels left of the centre of the apparatus, so the output would be 2.048 - (0.0064 x 60) = 1.664V. As you might imagine, the first option is usually the simplest, but the second option has the advantage that the voltage output is normalised by the image width, i.e. with an image that's 640 pixels wide and an analogue output with a range of 0-4.095V, one pixel is always 0.0064V.
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T0272 |