Last active
October 22, 2020 10:07
-
-
Save lacan/a005c15c6a8735d7d904e85b9663b82d to your computer and use it in GitHub Desktop.
[Nomalize Line Profile] Normalizes line profiles by making use of the Straighten command followed by scaling #Macro #ImageJ #Fiji #BIOP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Normalizes line profiles by making use of the Straighten command followed by scaling | |
* By Olivier Burri, BioImaging And Optics Platform | |
* In Response to http://forum.imagej.net/t/average-pixels-with-line-tool/6408?u=oburri | |
* | |
* OUTPUT is the values of the line profile as a results table | |
* Column name is the image name. | |
* the number of rows corresponds to the normalization length normLength | |
*/ | |
normLength = 200; //px the final length you want | |
lineWidth = 10; // Line thickness to average intensities along the perpendicular axis | |
imageName = getTitle(); | |
run("Straighten...", "title=SubImage line="+lineWidth); | |
run("Scale...", "x=- y=- width="+normLength+" height="+lineWidth+" interpolation=Bilinear create"); | |
run("Line Width...", "line="+lineWidth); | |
makeLine(0,lineWidth/2, normLength, lineWidth/2); | |
data = getProfile(); | |
for(i=0; i<normLength; i++) { | |
setResult(imageName, i, data[i]); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment