var milled; var scale; var name; var horse; var leg; var section; var site; var confocal; var left; macro "Show Dialog... [b]" { open(); name = getTitle(); open(); confocal = getTitle(); sync = isOpen("Sync Windows 1.4.1"); if (sync == false) run("Sync Windows"); //Set scale automagically //This macro is for use with 200x images //At 2048x2048 resolution //and 0.2160 microns per pixel // The following section gets useful information from the filename horse = substring(name, 0, 2); leg = substring(name, 2, 3); section = substring(name, 3, 4); site = substring(name, 4,6); res = getHeight(); if (res==1024) scale = 1.7448; else if (res==2048) scale = 0.2160; //failsafe value else scale = 1; //need to have a line selection for line width to work makeLine(1,1,0,0); if (res==1024) run("Line Width...", "line=10"); else if (res==2048) run("Line Width...", "line=25"); else run("Line Width...", "line=1"); //give the BSE window the focus selectWindow(name); //Make a dialog box Dialog.create("Specimen Information"); Dialog.addCheckbox("Lateral to left (uncheck if to right)", true); Dialog.addNumber("Scale", scale, 4, 6, "µm / pixel") Dialog.show(); left = Dialog.getCheckbox(); scale = Dialog.getNumber(); setVoxelSize(scale, scale, 1, "micron"); selectWindow(confocal); setVoxelSize(scale, scale, 1, "micron"); selectWindow(name); //use logical values to reassign site to the correct side (lateral to left) siten = parseInt(site); if (left==false && siten == 11) site = 17; else if (left==false && siten == 12) site = 16; else if (left==false && siten == 13) site = 15; else if (left==false && siten == 15) site = 13; else if (left==false && siten == 16) site = 12; else if (left==false && siten == 17) site = 11; else if (left==false && siten == 14) site = 14; else if (left==true) site = siten; else site = 99; } macro "Calcein and qBSE [t]" { requires("1.34h"); var bmmd; var fraction; //get the pixel information from inside the ROI getRawStatistics(count, mean, min, max, std, histogram); //use these lines to manually control the threshold lower=1; upper=255; for (k=0; k