Citation:
/** Returns the perimeter length of ROIs created using the
wand tool and the particle analyzer. The algorithm counts
edge pixels as 1 and corner pixels as sqrt(2). It does this by
calculating the total length of the ROI boundary and subtracting
2-sqrt(2) for each non-adjacent corner. For example, a 1x1 pixel
ROI has a boundary length of 4 and 2 non-adjacent edges so the
perimeter is 4-2*(2-sqrt(2)). A 2x2 pixel ROI has a boundary length
of 8 and 4 non-adjacent edges so the perimeter is 8-4*(2-sqrt(2)).
*/