Scripts

 

See the paper Ramazani et al. 2007 to get started.


These programs expect that the image files are numbered consecutively. Our image files are numbered something like this, trial001-00000001.jpg, trial001-00000002.jpg, etc. Place the program in the directory with the images to be analyzed. You must modify the header to the script to include the correct position of cells (vials, dishes, flies, whatever).

This program will produce a bunch of output images that have names like this:

cell_000.00001.jpg      cell_001.00001.jpg     cell_000.00002.jpg      cell_001.00002.jpg

In this example, 000 and 001 refer to the cell numbers. 00001 and 00002 refer to the image number. These output files are processed by the quantify programs.  The reason for separating the two is that sometimes one wants to adjust the quantization threshold. Works with both ImageMagick version 6.3.5 & 6.3.0.


Settings that you will need for each program.

How to identify the position of cells

Modify the header like this


Comparison programs

1. sliding_window_pl.tar.gz

This program will allow one to detect movement that occurs between frame 1 and 2, frame 3 and 4, etc.


Find more information about how to run the program type “perl sliding_window.pl” with no arguments.


Archive with examples for sliding window and quantify: sliding_window_example.tar.gz


2. nested_window_pl.tar.gz

This program will allow one to detect movement that occurs between frame 1 and 2, frame 2 and frame 3, frame 3 and frame 4, etc.


3.  comparetofirst_staggered_pl.tar.gz

We use this program to determine when flies wake up from sedation. It detects when flies move into an empty field of view. The flies are sedated and lying on the floor of an inverted vial. When they wake up they climb up the walls of the vial. This program takes the first cell as a “blank” which is subtracted from each and every consecutive photo. As long as the flies are sedated the image is black and quantify.pl will not detect any pixels. When the flies climb the subtraction generates a white image of them and then quantify.pl will detect the pixels. More flies equals more pixels.

This program will allow one to detect movement that occurs between frame 1 and 2, frame 2 and 3, frame 3 and 4, etc.

To find out more information about how to run the program by typing “perl comparetofirst_staggered.pl”.

Archive with example for comparetofirst_staggered.pl: comparetofirst_example.tar.gz. You will need to download a quantify program to complete the analysis.

more info comparetofirst_staggered


4. 2_1comparefirstnotstaggered_pl.tar.gz

To find out more information about how to run the program by typing “perl comparetofirst_staggered.pl”.
This is basically the same as the previous program except that it skips the staggered stuff. Thus, it assumes that the first photo is the correct blank for each and every cell.


5. tellmewhentheymove_pl.tar.gz

This program will tell you when an animal leaves a given position. We use it to monitor sedated non-moving flies. When they wake up, they move and the program records the time of this event.

“perl tellmewhentheymove.pl will provide more info.

sampleimagesfortellme.tar.gz

more info, example photos & the output

This version works well with ImageMagick version 6.3.5 and 6.1.8.


6. tellmewhentheymove630_pl.tar.gz

This version works well with ImageMagick version 6.3.0.


Quantifying programs

1. quantify635_pl.tar.gz works with ImageMagick version 6.3.5.
This is the version on our Macs.


2. quantify630_pl.tar.gz works with ImageMagick version 6.3.0.
This is the version on our Linux box.

The quantify programs are used to process the cell_xxx.yyyyy.pl files like this: “perl quantify635.pl 128 cell_*.jpg”

The number 128 is the white threshold. The images which are being analyzed are 256 bit black & white images. We find that the midpoint of 128 is the best selection in many cases. A bunch of stuff will show up of the screen. The results will be placed in a tab-delimited text file that you can import into a spreadsheet.

The results.txt file looks like this. The numbers are the white value. A higher white value indicates more movement.

cell_000        cell_001

3180                  2863

2974                  2652

3477                  2359

After your finish quantization you can delete the cell_xxx.yyyyy.pl files from a terminal with this command: “rm cell_*.jpg”.