TITLE: No Title
AUTHORS: 

[BEFORE_START]
Glue the flies on hooks, put them into the single-fly valves and give them sugar and water to survive the night. Store them at the appropriate temperature.

[GUIDELINES]
<p><strong>The day before the measurement:<br /></strong>Glue the flies on hooks, put them into the single-fly valves and give them sugar and water to survive the night. Store them at the appropriate temperature<strong><br /><br />The day of the measurement:</strong><br />1. Put the fly in position<br />Select a fly and put it in the clamp. Then put the clamp in the holder and position the ping-pong ball (or generally, the measurement environment) around the fly.<br />2. Set up the camera<br />Start the computer and open fview (either by typing &ldquo;fview&rdquo; in a terminal or clicking the fview symbol on the launcher). Close the error message that fview produces.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/FviewStart.png" target="_blank"><img class="alignnone size-medium wp-image-1244" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/FviewStart-400x204.png" alt="FviewStart" width="400" height="204" /></a></p>
<p>Then initialize the camera (click &ldquo;Camera&rdquo; -&gt; &ldquo;Initialize Camera&rdquo; and click OK in the window that pops up).</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/InitializeCamera1-e1427971217579.png" target="_blank"><img class="alignnone size-medium wp-image-1245" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/InitializeCamera1-375x300.png" alt="InitializeCamera1" width="375" height="300" /></a><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/InitializeCamera2.png" target="_blank"><img class="alignnone  wp-image-1259" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/InitializeCamera2-400x90.png" alt="InitializeCamera2" width="604" height="136" /></a></p>
<p>&nbsp;</p>
<p>If fview does not list your camera as a candidate for initialization, you may have to configure your connection to the camera. Go to the Ubuntu System Settings and select &ldquo;Networks&rdquo;. Here, select the connection via which the camera should be connected to your computer. Open &ldquo;Options&rdquo; and &ldquo;IPv4 Settings&rdquo; and set &ldquo;Method&rdquo; to &ldquo;Local Only&rdquo;.</p>
<p>In case the image you get after initialization is very small (only a tiny square in the upper left corner of the fview window), change to a different desktop and back. This should usually solve the issue.</p>
<p>Open the camera settings (via &ldquo;Windows&rdquo; -&gt; &ldquo;Camera Controls&rdquo;) and put the &ldquo;shutter(msec)&rdquo; to 20. During the actual recording the shutter should be at 10 msec to reach a sampling rate of ~100Hz, but for the setup it is more convenient to have it at 20 or 30. Now adjust the gain until you can see something on the picture. Then use the micro-manipulator to move the camera until you have a good image of the fly.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/Screenshot-from-2015-04-02-11_40_32.png" target="_blank"><img class="alignnone size-medium wp-image-1255" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/Screenshot-from-2015-04-02-11_40_32-400x261.png" alt="Screenshot from 2015-04-02 11_40_32" width="400" height="261" /></a><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/FindTheFly.png" target="_blank"><img class="alignnone size-medium wp-image-1248" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/FindTheFly-219x300.png" alt="FindTheFly" width="219" height="300" /></a></p>
<p>Before you start strokelitude, make sure that the display update interval is set to 1. During the recording, you may want to set this higher in order to be able to use lower values of &ldquo;shutter (msec)&rdquo; in the camera controls (i.e. a higher sampling rate). If you use a 10msec shutter with a display update interval of 1 it may happen that the program crashes. However, when you change settings in strokelitude, you should have a display update interval of 1, since the program might crash otherwise for unknown reasons.</p>
<p>To set the display update interval, go to &ldquo;View&rdquo; -&gt; &ldquo;Set display update interval&hellip;&rdquo;.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SetDisplayUpdateInterval.png" target="_blank"><img class="alignnone size-medium wp-image-1256" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SetDisplayUpdateInterval-375x300.png" alt="SetDisplayUpdateInterval" width="375" height="300" /></a><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SetDisplayUpdateInterval2.png" target="_blank"><img class="alignnone size-medium wp-image-1257" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SetDisplayUpdateInterval2.png" alt="SetDisplayUpdateInterval2" width="332" height="154" /></a></p>
<p>Open strokelitude. Go to &ldquo;Windows&rdquo; -&gt; &ldquo;-=|strokelitude|=-&ldquo;. The click &ldquo;Draw Mask&rdquo;.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/DrawMask.png" target="_blank"><img class="alignnone size-medium wp-image-1253" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/DrawMask-316x300.png" alt="DrawMask" width="316" height="300" /></a></p>
<p>This will make some green lines appear on the screen. This is the mask for recording the fly. The two small circles should be on the roots of the wings and the line linking them should be orthogonal to the fly&rsquo;s body axis (i.e. the orthogonal green line should be on the fly&rsquo;s body axis). Unless you are very lucky (or very precise at fly handling), you will have to adjust the mask. To do this, click &ldquo;Maskdata&rdquo;. Another window will open.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/OpenMaskdata.png" target="_blank"><img class="alignnone size-medium wp-image-1261" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/OpenMaskdata-316x300.png" alt="OpenMaskdata" width="316" height="300" /></a><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/MaskdataSettings.png" target="_blank"><img class="alignnone  wp-image-1260" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/MaskdataSettings-400x201.png" alt="MaskdataSettings" width="597" height="300" /></a></p>
<p>Use these parameters to fit the mask to the fly. With &ldquo;gamma&rdquo; you can rotate the mask and with &ldquo;X&rdquo; and &ldquo;Y&rdquo; you can shift it. Use these three parameters to position the two small circles to the wig hinges. You can manipulate the distance between the circles with &ldquo;wingsplit&rdquo;. Then you can use &ldquo;R1&Prime; and &ldquo;R2&Prime; to manipulate the inner and outer radii of the measurement sectors. With &ldquo;alpha&rdquo; and &ldquo;beta&rdquo; you can adjust the anterior and posterior borders of the measurement sectors. In general, these sectors should be positioned such that the anterior end of the wingstroke always falls inside. Optimally, nothing except for the wings should be within the sectors.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SettingUpMask.png" target="_blank"><img class="alignnone size-medium wp-image-1258" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SettingUpMask-400x175.png" alt="SettingUpMask" width="400" height="175" /></a></p>
<p>&nbsp;</p>
<p>When you have set up the mask, close the window &ldquo;Mask Parameters&rdquo; and click &ldquo;Antennae tracking enabled&rdquo; in strokelitude.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/EnableAntennaTracking.png" target="_blank"><img class="alignnone size-medium wp-image-1246" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/EnableAntennaTracking-316x300.png" alt="EnableAntennaTracking" width="316" height="300" /></a></p>
<p>&nbsp;</p>
<p>This will make some more lines appear on the screen. Unless you are interested in tracking antenna movements, you can safely ignore those. Enabling antennae tracking is necessary, since strokelitude does not save the data otherwise.</p>
<p>As soon as you have enabled antennae tracking, you can set the display update interval back up, e.g. to 5. Now you can also set the &ldquo;shutter (msec)&rdquo; in the camera controls to the value you want to use during the recording (e.g. 10). This will change the brightness level of the video.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/AdjustShutterAndGain.png" target="_blank"><img class="alignnone size-medium wp-image-1250" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/AdjustShutterAndGain-400x261.png" alt="AdjustShutterAndGain" width="400" height="261" /></a></p>
<p>&nbsp;</p>
<p>Turn on the infrared LED and put the filter in front of the camera (or adjust the lighting in whatever way is necessary for your experiment). Adjust the &ldquo;gain&rdquo; in the camera controls until you see a clear picture, where the wings of the fly are very bright and the background is very dark.</p>
<p>Go back to strokelitude and click &ldquo;Processing enabled&rdquo;.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/EnableProcessing.png" target="_blank"><img class="alignnone size-medium wp-image-1247" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/EnableProcessing-316x300.png" alt="EnableProcessing" width="316" height="300" /></a></p>
<p>This will make two new green lines appear. They originate from the two small circles and go through the measurement sectors. These lines indicate the position that strokelitude calculates for the wing. This is the data you will record (even though you are not recording yet). Make sure that these lines track the wings well. Optimally, they should always be exactly on the border of the wing.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/CheckTracking.png" target="_blank"><img class="alignnone size-medium wp-image-1252" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/CheckTracking-378x300.png" alt="CheckTracking" width="378" height="300" /></a></p>
<p>You can use &ldquo;gain&rdquo; to make the image brighter or darker. Also, the parameters &ldquo;Mask thresh&rdquo; and &ldquo;Max g&rdquo; (below the &ldquo;Processing enabled&rdquo; bottom in strokelitude) may be helpful. Raising max g may reduce the amount of error (frames in which strokelitude looses track of the wings). The mask threshold determines at which brightness level strokelitude estimates the border of he wing. As a rule of thumb, if the tracking lines jump down into the dark background area, you should raise the threshold. If the tracking lines jump up into the bright areas of the wing, you should lower the threshold.</p>
<p>However, pay attention to how homogeneous the wings are. Ideally, the wings should be a uniform white smear and the background should be black. If there is a bright stripe at the front of the wing and then a somewhat darker area behind it, this may lead to trouble, since strokelitude may switch between the two borders of the bright area. Sometimes it can help to put the measurement vectors further outside or further inside. Also, make sure that both wings are illuminated equally well, otherwise optimizing the settings for one wing will make you loose the other.</p>
<p>Once you made sure that strokelitude tracks the wings well, you can start the actual recording. Untick &ldquo;Processing enabled&rdquo; and select &ldquo;Save to disk&rdquo; (to save data in .h5 format) and &ldquo;Write data to a text file&rdquo; (to save data in .txt format). Then click &ldquo;Processing enabled&rdquo; to start the recording. If you want to record a video while you save the data, click &ldquo;Start recording&rdquo; in the camera controls.</p>
<p><a href="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SaveData.png" target="_blank"><img class="alignnone size-medium wp-image-1254" src="http://lab.brembs.net/wp/wp-content/uploads/2015/04/SaveData-316x300.png" alt="SaveData" width="316" height="300" /></a></p>
<p>Once you have finished the recording, disable processing. Find the data files, rename them and sort them (it is best to do this after every recording, since the file names strokelitude generates are generic). You can set the output directory under &ldquo;File&rdquo;. If you make several recordings, make sure to close fview between the sessions. Otherwise, strokelitude will continue to write the data into the same file.</p>

[STEPS]