Batch analysis: movies - galizia-lab/pyview GitHub Wiki

With this, we have seen the three main output options: overviews, traces, movies.

Now it is time to automate the output, in order to apply the same flags (i.e. the same mathematics) to all measurements, to all animals, so that we can compare the results across conditions in a rigorous way.

Automation is done off-line. The important aspect here: off-line analysis and interactive analysis in VIEW use the same code! Therefore, preparing all flags in VIEW will then allow to run the off-line system. That is: you test overviews, traces and movies in interactive mode, select the best flags, and save those flags into a .yml file. And then you use that .yml file for batch analysis.

In this tutorial, let’s first export movies.

Batch analysis is done by running a python script. In the folder “06_PROGS”, you will find the file export_movies_synthetic.py.

You can run this file directly in python, remember that you need to be in the environment created for view (e.g. conda activate view_py310, if view_py310 was the name you have given to the environment. You might have to change directory to this 06_PROGS folder (e.g., in windows, type “cd ” in the command line and then drag and drop the 06_PROGS folder and press enter). Once you are in the right folder, and in the right environment, you can call the program on the command line: ‘python export_movies_synthetic.py’. Alternatively, you can run the program from within a python editor.

Please adapt this file to your own data/settings. Note the following most important things:

  • Within each animal, specify which measurements are to be evaluated (in column “Analyze” of the animal.list file, i.e. the file Synthetic_data_strip.lst.xls in this tutorial; see below).
  • Specify which animals are to be evaluated (here it is “Synthetic_data_strip”. It is always the stem of the animal.list file)
  • Define “moaf”, the mother of all folders, if you are using a different folder structure from our standard

In the code of export_movies_synthetic.py you will find the variable Analyze_column_values_to_use:

This variable indicates which lines of the animal.list file to use (of the 02_LISTS/Synthetic_data_strip.lst.xls in our case). Open that file, and in column “Analyze”, insert, for each row, what you want to do with that row. In our example, all lines have the value “1”.

Since in our example analyze_values_to_use=(-1,1), all lines will be analyzed. You could set some lines to value “2”, or value “3”, and thus create different subgroups. In our group, the tradition is this: value ‘-1’ for measurements that we did not yet look at in detail, value ‘0’ for measurements that need to be excluded (e.g. strong movement artefacts), value ‘1’ for good measurements, other values for special cases.

Running the program will create movies for each measurement in subfolders of 04_OUTPUT, using the flags specified in view_synthetic_666.yml (or the .yml file specified).

Previous page Contents Next page
Generating Movies Contents Batch analysis: tapestries