{ NEURITE LABELLING MACROS v. 1.1 6/13/94 By Charles Thomas Integrated Microscopy Resource University of Wisconsin - Madison 1675 Observatory Drive Madison, WI 53706 (608) 263-6288 EXPLANATION: This macro allows a user fill in the cell body of a neuron, measure the length of neurites while counting them, label the neurites as measured and counted, and record the order of the neurite (e.g. primary, secondary, tertiary, etc.). INSTRUCTIONS: - Load the macros into NIH-Image using the 'Load Macros' command under the SPECIAL menu. - Run the first macro "Initialize" by hitting F1. This sets everything up to use the macro. - Set the line tool to "Freehand" by clicking on the line tool and holding the mouse button down until the menu comes up. - Open the image of the neurites you wish to count. - Outline the cell body with the line tool and press F2 "Mark Cell Body". This will fill in the cell body in black. - Trace the first primary neurite, hit F3 "Label Neurite" to measure and label it. Repeat for all primary neurites. - Hit F4 "Increase Order Number". Begin tracing secondary neurites hitting F3 after each one is traced. - Repeat labeling and Increasing order until all neurites are counted. - Hit F5 to save your work. There is a line commented off in this macro which will allow you to save only your tracings and labels. Left as is, the macro will save the image with the tracings as "filename.marked". Your results will be saved in a text file called "filename.measurements" which can be imported into any spreadsheet or graphing program. } VAR i, BranchOrder, StructureNum, left, top, width, height: integer; Initialized: boolean; PictureName: string; procedure LabelNeurite; begin rUser1[i]:=BranchOrder; {Set User1 array position to show BranchOrder} rUser2[i]:=StructureNum; {Set User2 array position to show StructureNum} Measure; {Do the measurement} MarkSelection; {Label line with Measurement number} RestoreROI; DrawBoundary; {Mark the line} KillROI; i:=i+1; {Increment our counter} end; {LabelNeurite} macro 'Initialize [F1]'; begin ResetCounter; {Clear the old measurements} ChangeValues(255, 255, 254); {Set all 255 values in image to 254} SetForegroundColor(255); BranchOrder:=1; StructureNum:=1; i:=1; SetUser1Label('Order'); SetUser2Label('Struct.'); rUser1[1] :=BranchOrder; rUser2[1]:=StructureNum; Initialized:=True; ShowResults; end; {Initialize} macro 'Mark Cell Body [F2]'; begin GetROI(left, top, width, height); if width = 0 then PutMessage('First outline the cell body!') else fill; end; macro 'Label Neurite [F3]'; begin PictureName:=WindowTitle; {Set variable PictureName to the title of the window we're working in} If not Initialized then begin PutMessage('Use the INITIALIZE macro first.'); exit; end; {Make sure we're initialized first} SetOptions('User2, Length, User1'); {Set up Measurement options} LabelNeurite; {Measure and label the traced structure} StructureNum:=StructureNum+1; {Increment the structure number counter} end; {Neurite Labelling} macro 'Increase Order Number [F4]'; begin BranchOrder:=BranchOrder+1; StructureNum:=1; end; {Increase Order Number} Macro 'Save the Work [F5]'; begin {ChangeValues(1, 254, 0); Uncomment this to save only markings} SaveAs(concat(PictureName, '.marked')); {Save the marked image} SelectWindow('Results'); {Choose the results window} SetExport('Measurements'); Export(concat(PictureName, '.Measurements')); {Save the measurements} PutMessage('File: ', PictureName, '.Measurements'' saved to disk'); {Tell 'em that you saved it} end; {Save the Work}