First time poster. Normally, I find that strange macro code outputs are entirely due to my own hackery. This time, I’m stumped though. If anyone can confirm or explain the behavior below, I’d appreciate it.
In a nutshell, I need a macro function that outputs getProfile() based arrays with arbitary segment midpoint position, segment length, angle, and averaging width as inputs. It’s convenient to do this based on a midpoint pixel rather than to use the makeLine start & endpoint arguments directly.
That didn’t seem like a big deal until I wrote and tested the function and had some unexpected behavior pop up. The function works exactly as expected as long as the averaging width is kept at 1. If the averaging width is increased to more than 1, then the output array lengths are no longer the same size as angle is changed. I’ve played a little bit with different segment lengths and averaging widths, and can’t find any obvious consistency other than that the output array lengths are not constant if averaging width is more than 1.
Has this been observed before?
Script attached. Run it with any available 8bit image. First run: leave profile width = 1. Second run: change profile width to 2. Array lengths should be constant for profile width = 1 and show angle-dependent behavior for profile width = 2. (See attached screenshots of results for examples.)
Angle_profile_test.ijm (2.5 KB)