ANY-maze Help > The ANY-maze reference > The Tests page > Running tests > After testing > Re-tracking from a test's video

Re-tracking from a test's video

Introduction

In some circumstances you may wish to re-track a test from the video of the test which was recorded when you originally performed the test. A classic situation in which this is helpful, is if you performed a test with the Animal colour set to 'darker' when really the animal was 'lighter' than the background. In this case the tracking will have been completely wrong, but simply correcting the animal colour and then re-tracking the test from its video will resolve the problem.

 How to re-track a test 
 The differences between re-tracking and re-performing a test 
 Why you can't re-track a test that was paused when originally performed 
 Why (in rare circumstances) the tracking and input/output results of a re-tracked test may not align perfectly  

How to re-track a test

There are two ways to re-track a test:

 Open the Testing status menu on the Test schedule report (by clicking the little down arrow next to the testing status) and then select Mark this test to be re-tracked from the test's video from the options which appear. 
 Alternatively: 
 1.Click the Test number on the Test schedule report. 
 2.The Test details report will open. 
 3.Click the Mark test to be re-tracked from test's video button in the ribbon bar. 
 4.Click the Back button shown in the report's title bar to return to the Test schedule report. 
 5.The test will be scheduled as the next test to perform (unless there are other tests to be re-tracked before it).  

Starting the test at a different time in the test's video

Tests are always re-tracked from the same video as was used/recorded when the original test was performed. And ANY-maze will automatically start the test, and usually end it, at the same times in the video as it started/ended when it was originally performed. However, you may wish to start the test at some other point in the video, indeed this might be the whole reason why you want to re-track the test.

You can do this by setting up the test to be re-tracked, as per the instructions above, and then clicking the little arrow next to the button and un-checking the option Start the test at the same point in the video as it originally started.

IMPORTANT: If you do this then ANY-maze will act in the same way as it would have if you had chosen to re-perform the test - see the above section describing the differences between re-tracking and re-performing a test.

Changing your mind

Having specified that you want to re-track a test you can still change your mind. Either select Un-mark test to be re-tracked from the test's video from the Testing status menu, or return to the Test details report and select the Un-mark test to be re-tracked from test's video button in the ribbon bar.

Note that once you actually have re-tracked the test then you can't do this anymore.

The results of a re-tracked test replace the original TRACKING results

When you re-track a test the tracking related results of the re-tracked test replace the results of the original test, however input/output results are retained (unless you chose to start the test at a different time in the test's video).

Note that there is then no way to recover the original results should you change your mind, although this is only the case after the test has actually been re-tracked - until then you can simply cancel the request to re-track the test, as described in the section above.

Until it is re-tracked the test continues to have its original results

When you specify that a test is to be re-tracked, ANY-maze simply notes your request and schedules the re-tracking of the test as the next thing to do. However, until the test is actually re-tracked the results of the original test are still valid and will be shown in all relevant reports.

The differences between re-tracking and re-performing a test

You may be wondering what the difference is between re-tracking a test from a test's video and re-performing a test. Although these options sound quite similar, there are some important differences:

  

Re-tracking a test from the test's video

 When you re-track a test, you are always working from the video that was recorded when the test was originally performed. This means that even if the original test was performed live, when re-tracking, the animal is not interacting with the apparatus again, you're just reassessing the tracking from the video of the original test. 
 When you re-track a test the results of the inputs and outputs are retained and only the tracking data from the original test is replaced with the tracking data generated by re-tracking. 
 When you re-track a test, ANY-maze automatically selects and plays the video it recorded of the test and automatically starts the test at the same time in the video as it was originally started. 
 You can't re-track a test which doesn't include video tracking and/or freezing detection. 
 You can't re-track a test which didn't have a video recorded when it was originally performed.  

  

Re-performing a test

 When you re-perform a test, the test in completely re-done. If the original test was performed live then re-performing the test means the animal will go back into the apparatus and will interact with it again (which can be especially important if the apparatus includes inputs or outputs, such as levers or a shocker). Of course this means that the animal's behaviour may be different because of its previous interaction with the apparatus - for this reason re-performing tests that were performed live is generally not recommended.  

That said there are legitimate reasons for doing it, for example, you started the test without intending to (perhaps the animal wasn't even in the apparatus) - if the results of this erroneous test were saved, then re-performing the test (with the animal now in the apparatus) would be an entirely appropriate thing to do.

 Re-performing a test which was originally run from video is often a useful thing to do, and is actually very like re-tracking the test, except that the video being used isn't one that was recorded by ANY-maze during the original test. 
 When you re-perform a test ALL the results, including any for the inputs and outputs, are replaced by the results generated by the re-performed test. 
 You can re-perform any test.  

Why you can't re-track a test that was paused when originally performed

It is not possible to re-track a test that was paused at any point during its original performance.

The reason for this restriction is that while the test was paused, the video recording of the test continued. As a result, re-tracking the test from the video would include both the paused and unpaused parts, leading to the following issues:

 You wouldn't be re-tracking the same behaviour. 
 ANY-maze wouldn't be able to perfectly align keys, inputs, or outputs between the original test and the re-tracked version.  

The solution is to re-perform the test instead, although before doing so, I recommend you review the section above about the differences between re-tracking and re-performing a test.

If you do re-perform the test, then you will be able to choose whether to manually pause the test at the same times as it was paused in the original. Doing so will mean you are (more or less) re-tracking the same behaviour as the original test. On the other hand, not doing so will mean the re-performed test includes the periods when the original test was paused - which may be the whole reason why you want to re-perform the test in the first place.

Why the tracking and input/output results of a re-tracked test may not align perfectly

When you re-track a test which includes input/output, ANY-maze retains the input/output results from the original test and merges them with the tracking results from the re-tracked test.

For example, imagine you ran a test in which the animal pressed a lever at time 10s and you then chose to re-track this test. When you re-track, all the original tracking data is discarded (assumedly it is erroneous in some way and that's why you are re-tracking it) and just the I/O results are retained - these is then merged in with the re-tracked data. So in our example, we might have detected that the animal was at a position of 100,100 at time 9.9s and at a position of 110,110 at time 10.1s (these values are all a bit unrealistic, but at convenient for this discussion). We already know that the animal pressed the lever at time 10s, so we should end up with results like this:

  9.900sAt 100,100 
 10.000sLever press 
 10.100sAt 110,110 

And this is exactly what we will get, provided the original test and the re-tracking test begin at exactly the same time.

Now, as you probably already know, video cameras generate a certain number of images (usually called frames) per second, often 30; so we might receive one frame at time 100.000s and the next one at time 100.033s. But a test can start at any time, so it might be that a test begins at 100.020s, i.e. between the two frames - this means that the first frame in the test will arrive 0.013s after the test began.

This is all relevant because it means that: a) When we ran our original, the time 10s into the test (when the lever was pressed) was 10s after the test began (nothing too unexpected about that!); b) The recording of the video of the test will have stored a video frame at time 0.013s (being the first frame received after the test, and therefore the video, started).

When we re-track, we do so from the video recording, so the test will start with the first frame in the video and this will be considered to be time 0s in the re-tracked test. If you think about this, you'll realise that this means that the re-tracked results will all be 0.013s (13ms) offset from the original test's results and this means that when the input/output results and the re-tracked tracking results are merged together they will be 13ms out of alignment.

In fact this problem only arises in the following specific situation (in all other cases there either won't be any misalignment, or ANY-maze is able to calculate what it is and compensate for it when it merges the re-tracked results with the original results).

 The original test was performed in version 7.35 or earlier of ANY-maze, AND... 
 The original test was performed from a standard format video, or it was performed from an ANY-maze .szv format video that was recorded using a version of ANY-maze prior to 7.20, or it was performed live using a version of ANY-maze prior to 7.20 and was automatically recorded by ANY-maze, AND... 
 ... the test includes results for inputs/outputs (such as lever, shockers, etc.), AND... 
 ... the original test was not 'auto-started'. 

In all other cases there will be no issues at all. But even when this misalignment could occur it will be no worse than a single frame time (typically 33ms) and on average it will be half of that. This means that in the majority of cases the problem either won't exist, or it will be unlikely to have a significant effect on your results.

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T1381