|
Hello,
Is there a way to get back the accurate scale from Imagej? I've used the
macro below to retrieve scale informaion, so I can save it in my
documentation:
ShowScale.txt:
// Demonstrates how to retrieve the scale of the active image
var scale, unit;
getScaleAndUnit();
print("Scale: "+scale+" pixels per "+unit);
// Sets the global variables 'scale' and 'unit'
// based on the 'Resolution: ' line from the
// active images 'Show Info' string.
function getScaleAndUnit() {
selectImage(getImageID);
info = getInfo();
index1 = indexOf(info, "Resolution: ");
if (index1==-1)
{scale=1; unit = "pixel"; return;}
index2 = indexOf(info, "\n", index1);
line = substring(info, index1+12, index2);
words = split(line, "");
scale = 0+words[0];
unit = words[3];
}
It prints out the scale, ok. But whenever I try to measure my ROIs again
after I've closed the image, and I set the scale the macro gives me back, I
get different results than my initial measurements. Not too much different,
but it's still not the same, so I cannot reproduce a full random measurement
again. I know 895940,983 is not much different from 897796.294 for example,
especially if I have 250 results, and I'll take AVG, STDEV and VAR in the
end, still I'd like to be able to fully reproduce my analysis any time I
want or I need.
Regards,
Ákos
|