Vector sum macro

Relevant to Figure 2, 3

This ImageJ macro calculates the vector-sum of each pixel in calcium imaging movies with a direction selective (DS) bar stimulus in 8 different directions (0-315 degrees in 45 degree intervals) presented 3 times in a pseudorandomized order (24 bar stimuli in total).
The ordering of the stimuli is unscrambled with the function sortAngles().
The function AvgStim() produces the average response per angle.

Parameters to change: 


Ouput: