// "Toe Indexer" // This macro allows easy measurement of footprints and calculation of toe index, // as defined by Webb et al. (2006) "Evaluating and improving footprint // measurement for clinical and scientific testing," Anthropologie, 44:269-279. // To use it, install this macro, open a JPEG file of a footprint, then begin // by pressing "1" for the first step (making a copy of the image, to avoid // damaging the original). Brief instructions for each subsequent step are // printed in the "Log" window, as are intermediate results of the various // measurements and calculations. This output can be customized by adding and // deleting various calculations and their associated "print" commands. // For more detailed instructions, visit my Webbpage at: // "http//faculty.kutztown.edu/webb/". var yAntToePt = "" var yPostHeelPt = "" macro "Copy Footprint [1]"{ doCommand("Select All"); doCommand("Copy"); doCommand("Select None"); run("Image..."); doCommand("Paste"); doCommand("In"); doCommand("Select None"); print(""); selectWindow("Log"); run("Close"); print("Place medial and lateral ball and heel points."); print("Then, press 2."); setTool(7); } macro "Draw 4 Points [2]"{ // Get the four points and draw the ball and heel lines getSelectionCoordinates(x,y); for (i=0; i=0) angle = PI/2; else angle = -PI/2; } angle = (180/PI)*angle; if (dx>=0 && dy>=0) quadrant = q1; else if (dx<0) quadrant = q2orq3; else quadrant = q4; if (quadrant==q2orq3) angle = angle+180.0; else if (quadrant==q4) angle = angle+360.0; return angle; } // Subroutine that calculates the length of the line segment between two // points. function getLength(x1, y1, x2, y2) { length = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); return length; }