The existing LineProfile output is rather unintuitive. It gives you a dx but the dx seems to always be 1. This is made apparent by taking line profiles in a radial pattern. The profiles between 0° and 90° return smaller arrays even though the lines are the same length. My suggestion is to allow the user to select the existing behavior but make dx accurate or to interpolate and use a step size of 1 pixel.