
>> Instructions for ImageJ AWC ASH Axon Data Acquisition Suite. 

This tracking suite utilizes three macros scripts: Movement_Correction, Movement_Correction_Check, and Data_Acquisition. These macros are used sequentially to remove any axon movement and acquire axon & background intensity measurements. 

// Movement_Correction - Image registration. This macro automates the "Align Slices in Stack" plugin from Qingzong TSENG's "Template Matching and Slice Alignment" ImageJ plugin collection. These can be downloaded at the url below. In Movement_Correction, the "Align Slices in Stack" plugin uses the following settings: Matching method = Normalized correlation coefficient; Search area = 0; Subpixel registration = unchecked. Align Slices in Stack uses rigid body transformation (in x- and y-) to align all frames in a image stack to a selected frame and ROI, and thus remove movement. The original tiff file is duplicated and this duplicate is used for registration (the original is left unaltered). Movement_Correction runs on a group of files as an automated first pass and aligns the tiff stack based on the first frame. At the end of this plugin a new folder containing the registered tiffs will be produced, along with a record of the x- and y- translations (in pixels). 

TSENG Template Matching and Slice Alignment URL:
https://sites.google.com/site/qingzongtseng/template-matching-ij-plugin#publications. 

// Movement_Correction_Check - Image registration continued. This macro asks the user to check if registration was successful for each file and if necessary, redo registration based on a more selective ROI. Movies that cannot be registered or are unsuitable for further analysis can also be flagged at this stage.

// Data_Acquisition - acquire axon & background intensity measurements. This macro is ran on the registered tiffs and allows the user to specify the axon either by intensity thresholding or by manually outlining the axon. Measurements of the whole axon, axon segments, and local background regions surrounding the axon are acquired (See Supplemental Methods). A txt file for each movie is saved, as well as a record of ROI positions and tracking settings.  The txt data file is organized as a series of columns, as follows: 


1. whole axon measurement:

'Area1'	'Mean1'	'StdDev1' 'IntDen1' 'Median1' 'RawIntDen1'

2. 1st axon segment: 

'Area2'	'Mean2'	'StdDev2' 'IntDen2' 'Median2' 'RawIntDen2'

3. 1st axon segment: local background measurements - Left Box

'Area3'	'Mean3'	'StdDev3' 'IntDen3' 'Median3' 'RawIntDen3'

4. 1st axon segment: local background measurements - Right Box

'Area4'	'Mean4'	'StdDev4' 'IntDen4' 'Median4' 'RawIntDen4'

5. The structure of 2-4 (above) is repeated for each addition axon segment.
 

General Instructions:

1. Place a group of files to be analyzed in a common folder.

2. Remove movement using image registration.
// Start ImageJ - Press "q" to launch Movement_Correction. Navigate into the folder containing the files for analysis. Movement_Correction will search for .tiff files and ask which file to start with (zero is the first file in the list). 

3. Check if registration was successful (the axon portion to be analyzed should not move at all). 
// Press "Q" to launch Movement_Correction_Check. Navigate into the folder containing the files for analysis, there will now be a folder containing registered files (do not go into this folder, run the macro on the current folder). Movement_Correction_Check will open each registered tiff file. Using the slider bar, scroll through the recording, noting if there was any movement. Press the Space Bar to continue. A dialog box will appear and ask if the movement was corrected. If unsuccessful, select "No" and press Okay; The original movie will be opened and a duplicate called "stack" will be produced. On the "stack" window, use the cursor to draw a box around the axon and press enter. Scroll through the recording and check if the movement was corrected. Repeating this process using different ROIs for registration may be needed to removed movement in certain cases (such as a low axon SNR; selecting unique features on or near by the axon may help in such cases). If the movement in a recording cannot be corrected or if there was significant z-plane focal drift, etc, the file can be flagged: uncheck the "Okay for tracking" box. 

A record of the registration translations will be created for each tiff file and are located in the folder "Tracks."

4. Data_Acquisition. 
// Navigate into the folder containing the files for analysis and into the subfolder "Registered Tiffs." Open the text file "List_of_untrackables.txt" A file marked for removal in Movement_Correction_Check will have a "1" in the list; Zeros are good files. Delete the Registered Tiffs file(s) that need to be removed.

Open ImageJ. Press "t" to launch Data_Acquisition. Navigate into the folder containing the files for analysis and into the folder "Registered Tiffs." 

Follow text prompts:

"Select region containing only axon" - Here draw a box that will encompass the axon and surrounding background to be analyzed, make sure the box is large enough to contain the automated background selection (at least ~40 pixels from the edge of the axon on each side). Press the Space Bar to continue. A series of windows will open.

"Select axon threshold" - use the threshold dialog box to select a pixel intensity threshold that contains the axon. This is to be done on the AVG_filtered window.

* If thresholding cannot isolate only the axon or can only highlight part of the axon (etc), hold the "alt" key and press the space bar; The text prompt will now read "Outline Axon." Use the mouse pointer to closely outline the axon (Zooming in will aid in this process  - press plus or minus keys to zoom in or out). 

Press the Space Bar to continue. The macro will take measurements of the whole axon, axon segments, and local background regions surrounding the axon.

The macro will produce folders: Data, and ROI Positions. Data contains txt files for each recording that contains all intensity measurements (outlined as indicated above). ROI Positions contains two file types: ROIs.zip contains a record of the ROI positions used to capture the measurements in data. These zip files can be opened with the imageJ ROI manager (Analyze > Tools > ROI manager). Tracksettings contains a record of the settings used. Using the coordinates for the "Box (x,y,w,h) used to crop out axon in registered image" in combination with the ROI manager and the ROIs.zip file, one can view the positions of all the ROIs used to capture the measurements in the data txt file.

>> End


>> AWC and ASH Soma GCaMP Image-J tracking script.

These imaging scripts were written by Gordus et al 2015 with minor modifications. See also Supplemental Methods.


>> AWC_ and ASH_VGLUTpH_Data_Import_and_Analysis Matlab Scripts

These matlab scripts import data from the txt files produced by the AWC ASH Axon Data Acquisition Suite. Briefly, the scripts collect row values from whole_axon: mean, axon_segments: mean, axon segments: local background left, axon segments: local background right columns. For analyzing the whole axon as a single measurement, the background is constructed from the local background measurements which each correspond to an axon segment. See also Supplemental Methods.

>> AWC_syGCaMP_Data_Import_and_Analysis and ASH_Axon_GCaMP_Import_and_Analysis Matlab Scripts

These matlab scripts import data from the txt files produced by the AWC ASH Axon Data Acquisition Suite. Briefly, the scripts collect row values from whole_axon: mean, axon segments: local background left, and axon segments: local background right columns. For analyzing the whole axon as a single measurement, the background is constructed from the local background measurements which each correspond to an axon segment. See also Supplemental Methods.


>> AWC and ASH SOMA GCaMP Import_and_Analysis Matlab Scripts

These matlab scripts import data from the txt files produced by the AWC and ASH Image-J tracking scripts. See also Supplemental Methods.
 

























