Last active
August 29, 2015 13:59
-
-
Save mutterer/10953925 to your computer and use it in GitHub Desktop.
This file contains 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
dir = File.directory; | |
data = dir+ File.nameWithoutExtension+".txt"; | |
if (File.exists(data)) { | |
data=File.openAsString(data); | |
setMetadata("Info", data); | |
List.setList(data); | |
size=split(List.get('$CM_FULL_SIZE')); | |
makeRectangle(0,0,size[0],size[1]); | |
run("Crop"); | |
pixels = List.get('$$SM_MICRON_BAR'); | |
label = List.get('$$SM_MICRON_MARKER'); | |
distance = substring (label,0,lengthOf(label)-2); | |
unit = substring (label, lengthOf(label)-2, lengthOf(label)); | |
cal = 1*distance/pixels; | |
setVoxelSize(cal, cal, 1, unit); | |
run("Scale Bar...", "width=100 height=8 font=28 color=White background=Black location=[Lower Right] bold overlay"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment