Skip to content

Instantly share code, notes, and snippets.

@mutterer
Last active August 29, 2015 13:59
Show Gist options
  • Save mutterer/10953925 to your computer and use it in GitHub Desktop.
Save mutterer/10953925 to your computer and use it in GitHub Desktop.
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