Calculate median intensity value of a segmented line with a certain width

Hello everybody!

I am trying to extract the median value for every point of a line with a certain width. In my case, I select 10 pixel width and for each point of the line I would like to calculate the median value of these 10 pixels in order to plot it as a profile plot of the distance from the starting point of the line.
Manually, I can get from the profile plot the mean - I think, it is not clear to me where to find it - but I would like to get the raw data to calculate the median or other stuff. It is a segmented line because I am trying to get the intensity of a membrane-tethered protein fused to GFP.

I am new to Macros and this is my very start

selectWindow(“C1-Exp5_last.tif”)
setTool(“polyline”)
waitForUser(“Image selection”,“Specify a segmented line. Press ok when ready.”);
Roi.getCoordinates(xx, yy);
Array.print(xx);
Array.print(yy);

How can I continue?
Thank you!!

Your line is not straight, but run("Straighten...","line = 10 title = myname") should get you a rectangular new image.
From there it is trivial to loop over the width of the new image, make a rectangular ROI of width 1 and height 10, makeRectangle() and measure with proper stuff in Set Measurements.