ANY-maze Help > The ANY-maze reference > The Protocol page > An introductory tutorial on protocols

An introductory tutorial on protocols

Introduction

Protocols are perhaps the most important part of ANY-maze, because it's through them that the system gains its power and flexibility. Clearly then, a good understanding of protocols is important if you're going to get the most out of the system.

In this tutorial, I'll explain how a protocol is structured and I'll introduce some of their more fundamental parts. We'll then go on to create a simple protocol for a water-maze which will contain everything necessary to track an animal.

It's a good idea to print this tutorial as you'll find it easier to actually perform the steps described if you're working from paper. Just click the Print button above to print it now.
  
 The structure of a protocol 
 The Protocol element itself 
 Adding a video source 
 Adding apparatus 
 Setting the tracking options 
 Setting the test duration 
 Finished - a simple but complete protocol  

The structure of a protocol

Before we do anything else, we need to create a new experiment file. To do this:

 Select the File page  
 Select New experiment from the list on the left.  
 The right side of the page will then show a list of protocol 'documents', the first of which is New empty experiment - click it.  

If you follow the above instructions, ANY-maze will create a new empty experiment and automatically switch to the Protocol page. On the left of this page is what we call the Protocol list which contains all of the parts of the protocol - see figure 1.

  

  

Figure 1. Part of the 'Protocol list'.

As you can see, the list is broken into different sections, each with a number of items inside it - for example, the Tracking section contains Zones, Points, Sequences, etc. These are what we call the elements of a protocol, and there are more than 50 in total. Fortunately, a protocol will almost never use all of them; rather they're like files in a filing cabinet where you can record information if you need to. For example, the element called Sequences can be used to record information about sequences of movements that you want ANY-maze to measure, but if your experiment doesn't involve any sequences which interest you, you simply won't include any.

In fact, there are a few elements which must be present in a protocol, otherwise ANY-maze won't have any idea what it's supposed to be doing, and it's these elements which we're going to look at here; the first of them is the Protocol element itself.

The Protocol element

The first element in all protocols is the Protocol element itself, and this is the element which will currently be selected in the Protocol list. Just to right of the Protocol list is a pane which we call the Settings pane, as it shows the settings of whatever element is currently selected in the Protocol list. So, the Settings pane will currently be showing the settings of the protocol itself - see figure 2

  

  

Figure 2. The 'Settings pane' shows details of the item that's currently selected in the Protocol list; in this case the Protocol element itself.

As you can see, the first field is the Protocol name, which for all new protocols defaults to 'Unnamed protocol'. You don't have to change this (although you do have to enter something), but it's usually a good idea to give the protocol a descriptive name - let's change it to 'Water-maze protocol'.

Just below the protocol name is a drop-down list which you can use to set the Protocol mode; opening the list will show you the available modes - see figure 3.

  

  

Figure 3. The Protocol mode drop-down list. The modes that are available depend on your ANY-maze licence.

As can be seen in the above figure, there are three groups of modes - Standard modes, TakeNote modes and Equipment-specific modes. For now, we will just consider the standard modes which essentially control what elements are included in the protocol - for example, changing to Input/Output only mode will remove the Video sources and Sequences elements (amongst others), as these are specific to video tracking.

The rest of this introduction assumes that the mode is Video tracking mode, which is usually the mode that is selected by default.

That's all we're going to do with the protocol element. Now we're ready to tell ANY-maze about our actual water-maze, and we'll start by adding a Video source.

Adding a video source

To add a video source, simply click the Add item button shown in the ribbon bar and select New video source from the menu which appears. In fact, you use this same technique to add any element to a protocol, so it's worth remembering how to do this - click the plus-sign button and then select the new item from the menu which appears.

Our new Video source element will now appear in the Protocol list and the Settings pane will show information about it - a video picture might also appear in the Image pane on the right-hand side of the screen.

OK, but what's a video source actually for? Well, as the name implies, a video source is essentially the source of a video picture but the really important thing is that it's the source of a video picture which shows a single piece of apparatus. This might not sound too important, but consider a situation in which you have two activity boxes placed close together - a single camera could probably see into them both. However, if we just used the video picture direct from the camera, ANY-maze would see two boxes, and presumably two animals, and this would make it rather complicated to perform tests in the two boxes independently. Video sources help resolve this and other issues related to the video pictures our camera (or cameras) can actually see. Using video sources:

 You can choose the camera, digitizer or video file from which images will be captured. 
 You can crop the image, so just your apparatus is visible. 
 If an image shows two pieces of apparatus, you can crop the image so just one of them is visible. You can then create a second video source, specify that it captures images from the same camera, and crop its image so that just the other piece of apparatus is visible. In fact, you can do this with any number of apparatus, not just two. 
 You can also use video sources to glue-together images from two cameras - this is called a montage and is very useful if a single camera can't see all of your apparatus.  

The important thing is that each of the video sources we create shows just a single piece of apparatus (this is important, so it's worth taking a moment to remember it) - see figure 4.

  

  

Figure 4. Using a video source, you can select just the part of a video image which shows a single piece of apparatus (the unshaded areas in the figure) - this is then the 'video source' for that apparatus.

Of course, a video source will often be extremely simple - you have a single camera, and it can see all of your apparatus and nothing else. In this case, the video source will just use the entire video picture from the camera and that's it. In fact, this is what we're going to do here.

 1.In the Settings pane, change the name shown for the video source from 'New video source' to 'Water-maze'.  
 2.Choose the source as 'An ANY-maze example video'. 

(If this option doesn't appear, it's because examples have been switched off in the Options > Features for new users page. To remedy this, switch the option on again.)

 3.In the drop-down list below these options, choose the entry called 'Water-maze example video'. A video of a water-maze will appear in the Image pane on the right.  

Ordinarily, of course, you wouldn't use a video; instead, you'd choose the camera or digitizer which shows the apparatus you want to use.

I'm not going to go into more details about video sources now, but if you want to learn more then you'll find full details in the Video sources topic.

So now we have a video source in our protocol which shows just our apparatus. But all the video source does is supply a video picture; it doesn't tell ANY-maze anything about what the picture actually shows - for that we need to add an Apparatus element to the protocol.

Adding apparatus

As I mentioned earlier, you always use the same technique to add things to a Protocol; click the Add item button in the ribbon bar and select the element you want to add from the menu which appears. So now; add a new Apparatus element.

As was the case when we added the Video source element to the Protocol, the new Apparatus element will appear in the Protocol list and the Settings pane will change to show details of it.

Before we do anything else, change the name of this new element from 'New apparatus' to 'Water-maze' - I imagine you're getting the idea about naming things by now!

Now take a closer look at the Settings pane, and you'll see a list titled Video source. If you had more than one video source (which you don't in this example), you could use this to choose the video source which shows just this piece of apparatus - see figure 4 above.

In our case, as we only have a single Video source in the protocol, ANY-maze will already have selected it for this apparatus and will already be showing the image from it in the Image pane on the right side of the page.

Now let's turn our attention to the Image pane on the right side of the page, because it's here that most of the work needs to be done. As you'll see, in the ribbon bar there's a section called Apparatus map which contains a number of drawing tools, and we're going to use these to draw a map of our apparatus on top of the video picture. If you've ever used any drawing software before then you shouldn't find this too hard to do, but I'll take you through it a step at a time anyhow:

 1.Click the Ellipse tool button. 
 2.Move the mouse pointer over the top left quadrant of the video image, press the left button down and (holding it down), drag the mouse down and to the right - an orange ellipse will appear. Try to make it roughly the same size as the water-maze, but don't worry too much because we'll move and resize it next. Release the left button. 
 3.Move the mouse pointer so it's pointing at any part of the ellipse you just drew (the pointer should change shape into a four-headed arrow) and click the left-hand button. Eight little boxes should appear, one in each corner of the ellipse and one on each pole point (if you're wondering how an ellipse can have a corner, just try it and you'll see what I mean). 
 4.Point the mouse at one of these boxes and click and hold down the left button. Now as you move the mouse, you'll be able to resize the ellipse. 
 5.If you want to move the ellipse, point at a part which isn't a little box and click and hold down the left button - you'll be able to move the entire ellipse. 
 6.Use these techniques to resize and move the ellipse until it nicely outlines the water-maze in the video picture, as in figure 5.  

  

  

Figure 5. The apparatus map after we've drawn the outline of the water-maze.

As you might expect, the other drawing tools work in much the same way. Using them you can draw boxes, lines, and multi-lines. The latter will draw one line after another - I won't go into the details here, but you'll find full information in the Drawing the apparatus map topic.

One other point; if you want to remove something you've drawn, click it with the mouse (so those little boxes appear) and then press the Delete key on the keyboard.

OK, returning to our water-maze, you should have a nice orange circle drawn around the outside of the maze. This is great, but the apparatus map isn't only intended to define the edges of the apparatus; it also defines areas within the apparatus which might be of interest to us.

For example, let's imagine that our water-maze includes an island - we'd want to draw this on our map too. No problem, click the ellipse button again and draw another small circle somewhere in the maze where you think your island might be, say in the top-left quadrant. But that's not all; let's say we're also interested to know how much time the animal spends in each of the quadrants of the maze - therefore we'll need to draw these quadrants on the map so ANY-maze can analyse this too. You'd probably think that an easy way to do this would be to simply draw two lines, one horizontally and one vertically, that divide the apparatus into four - and you'd be right - but in fact there's an even easier way; you can use a grid.

Click the Grid settings button and a window will appear in which you can select three types of grid. I won't go into the details; they can be found in Apparatus map grids. Just click the option to Include a radial grid and change the spacing from 30 to 90 degrees, then click OK - you should now have an apparatus map that looks like the one in figure 6.

  

  

Figure 6. The final apparatus map with an island and a 90-degree radial grid.

And that's our apparatus map. Of course, you can create much more sophisticated maps than this. Indeed, once you learn more about ANY-maze you'll see that many of the system's abilities stem from the apparatus map - it's an absolutely critical part of the protocol.

Now is probably a good time to mention that almost everything in a Protocol, including the apparatus map, is editable. Not just before you run an experiment, but during and afterwards too. I won't explain all the repercussions of this, but it's good to know that what you're doing isn't cast in stone and you can come back and make adjustments if you want to.

You may have noticed a green line at the bottom of the video picture which looks like a ruler or a scale of some sort, and wondered what it's for. Well, it is a scale - in ANY-maze it's called the drawing ruler - and you use it to tell ANY-maze how big your apparatus is.

If you point at it with the mouse, the pointer will change to a four-headed arrow and if you click and hold down the left mouse button, you can drag the ruler around the screen. Drag it up the screen and place its left-hand end over the 'west pole' point of the ellipse you drew around the water-maze. Now release the mouse button and move the pointer to the right-hand end of the ruler - the pointer will change to something like a cross. Click and hold down the left mouse button and you'll be able to move the right-hand end of the ruler while the left-hand end stays anchored where it is - effectively, you can stretch the ruler. Stretch it until the right-hand end is over the 'east pole' point, and release the mouse button - your map should now look like figure 7.

  

  

Figure 7. The apparatus map showing the drawing ruler positioned across the diameter of the maze.

Fine, but what does this drawing ruler actually do? Well, what you've done is to place the ruler across the diameter of the water-maze, which is a distance you'll probably know. Now in the Settings pane you need to enter this distance, in millimetres, in the field at the bottom of the page titled The length of the 'ruler' line is. Our water-maze is 1.2m across, so enter '1200'. Now that ANY-maze knows that the distance represented by the drawing ruler is 1200mm, it can calculate any other distance it needs. Thus all distances and speeds in ANY-maze will be reported in metres and metres per second, respectively.

In summary, you should position the drawing ruler along a known distance in the apparatus map, and then enter that distance in the Settings pane. One word of warning, however - make sure the ruler is measuring something that's in the same horizontal plane as the animals will be. For example, in an elevated plusmaze, measure the length of an open arm rather than measuring something on the floor of the room (which will be lower than the maze), because as you get further from the camera so the distances will appear smaller.

Enough about the apparatus! There are other things you can set, but we won't worry about them for now. In fact we're now close to having the essentials of a working Protocol; we just need to do a couple more things - the first is to specify the animal colour.

Specifying the animal colour

ANY-maze tracking is essentially automatic - you don't need to train it how to track animals, nor do you need to set any thresholds or other complex values. Nevertheless, there is one thing the system needs to know - the colour of the animals you intend to track.

The animal colour is specified using the protocol's Animal colour element, which is the first element in the Tracking group - select it. As usual, the Settings Pane will change, in this case to show the different options available for the animal's colour.

In fact, ANY-maze isn't exactly interested in the colour of the animal, what it really needs to know is whether the animal is lighter or darker than the background of the apparatus. In our water-maze, the animals are lighter so you should select this option in the Settings pane (you'll find more details about the other animal colour options in the Animal colour topic).

And that's the only setting that you have to make in order for ANY-maze to track your animals.

Setting the test duration

The next step in setting up our simple protocol is to specify the duration of the tests. This is done using the Stages element of the protocol, which is the first item in the Testing group. 

This element is so named because you can use it to set up different stages in a single experiment; however, in our example we're going to create just a single stage.

In fact, as you'll find if you click the Stages element in the protocol list, ANY-maze automatically includes one stage in all protocols when it creates them. This default stage is called 'First stage', although you can of course edit this to something more appropriate if you wish.

  

  

Figure 8. All protocols are automatically created with a default stage called 'First stage'.

Click this element in the protocol, and the stage's details will be displayed in the Settings pane.

As you'll see, apart from the stage's name, there are essentially two things to set - the test duration and the number (and order) of trials in the stage. For our simple protocol, we're going to have just a single trial (i.e. each animal will only ever be tested once), so the default value is fine, but we do need to set the Test duration. Our protocol is going to use 5 minute tests, so you can simply enter '5 min'.

Throughout ANY-maze, times can be specified using units of 'ms' for milliseconds, 's' for seconds, 'min' or 'm' for minutes, 'h' for hours and 'd' for days. You can mix these units if you wish, for example '3h 30min', and you can use decimal points, for example '3.5h'.

Finally, we're going to move on to the last element that we have to set, Treatment groups.

Treatment groups

Despite its name, the Treatment groups element of the protocol is not where you assign treatments to your animals. Rather, it is where you can choose whether or not you want your animals to be put into treatment groups and, if you do, how the animals will be assigned to the groups. This is all explained in detail here, but for now you can just choose the last option, Randomly assign the animals amongst the groups (which is quite likely to be what you'll want to do anyway).

Finished - a simple but complete protocol

We're done! You've now created a simple protocol which includes everything ANY-maze needs to know to actually run an experiment in our water-maze.

To recap:

 In the Protocol element, you specify the protocol mode you want to use. 
 In the Video source element, you tell ANY-maze where the video images are coming from and, when necessary, you select just the part of the image which shows a single piece of apparatus. 
 In the Apparatus element, you select the Video source which shows your apparatus and then draw an apparatus map over the top of it. You also use the drawing ruler to measure a known distance in the apparatus, so ANY-maze can work in real-world units such as metres and metres/second. 
 In the Animal colour element, you need to specify the colour of the animals you intend to track. 
 In the Stages element, you need to at least set the test duration of the default stage to the correct duration for your tests.  

Of course, as you can see in the Protocol list, there are many other Protocol element,s each of which adds certain abilities to the system (for example, in our water-maze we'd probably want to add a Zone to define the island) but they all follow the same structure and methodology as the elements we've looked at here.

See also:

 The elements of a protocol 
 Protocol errors and warnings 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0073