User's Manualver. 3.0
Nov 17, 2017

Azusa Kamikouchi

1. Before Using ChaIN
Download ChaIN (zip file) at: http://www.bio.nagoya-u.ac.jp/~NC_home/chain_E.html
Keep ChaIN.exe and ChaIN.ini in the same folder

2. Start ChaIN
Double click ChaIN.exe
Open the AVI movie file you will analyze. Time resolution of the movie file should be
1 fps to get the correct timestamp.
After converting the movie file into binary image, ChaIN picks up 40 frames between
301st and last frames (during the “sound” period) randomly to generate a backgroundimage. ChaIN automatically detects four largest “white” areas as chambers, each ofwhich would contain flies to be analyzed.

a.

Click “File” to open an AVI fileb.

Chain region defined by length and angle constantsc.

Enter the number of flies in each chamber

d.

Check, export, and import a background imagee.

Flies in chains are marked with red heart shapesf.

Select an image type on screeng.

Select a frame on screen. Note that “hh:mm:ss” shows a proper time only

when the time resolution of the movie file is 1 fps.
h.

Chain index scored by ChaINi.

You can revise the chain index manuallyj.

Analyze the frame on screen immediately

3. Export the result file
1. Chain index
Export the file as .csv file.

File > Export > CSV File

2. Images
Export serial images to your folder.

File > Export > All Image

Export an image on screen only.

File > Export > Current Image

4. Background correction
1. When is it required?
ChaIN picks up 40 frames between 301st and last frames randomly to generate abackground image. In case if flies do not move during this period, the silhouette offlies is regarded as a background. In such a case we recommend to correct thebackground image manually.
2. How does it work?
Save a background image. Erase the silhouette of flies manually using agraphics-editing program (e.g. Adobe Photoshop). Import the corrected image to
ChaIN as a background image. Analysis will be automatically restarted.

5. Modify the constants
ChaIN.ini defines the constants L and k. You can change these values on this file.
1. How to change the Length constant (L)?

At the 1st sentence you can see:
ChainDefaultLength = 13.0; Length constant (len)
L is set to be “13.0” in this first setting. You can change the value as you want.
2. How to change the Angle constant (k)?
In the second paragraph you can see:; Definition of the angle; deg = -90.0 / len * L*0.66+ 90.0; L=|PC|
VerdictChain.Param1st = -90.0; First constantVerdictChain.Param2nd = 0.66; Angle constantVerdictChain.Param3rd = 90.0; Second constantk is set to be “0.66” in this first setting. You can change the value as you want.

6. Tips
1. Setting a background image
ChaIN.ini defines other parameters such as the number of frames that are skipped
for background calculation. In the initial setting ChaIN is set to skip the first 300
frames, which means 5 min if the movie file is at 1 fps. It is defined in the .ini file
SkipFramesForBackGroundCalculation = 300
You can change the number of frames to be skipped as you like.
2. Sample data description
We distribute a sample data at:
http://www.bio.nagoya-u.ac.jp/~NC_home/chain_E.html
In this movie file Canton-S flies were exposed to an artificial pulse song of 35-ms
inter-pulse intervals between 5 min and 11.5 min. The time resolution of the movie
file was down-sampled to 1 fps before starting ChaIN.