Problems with Thresholding

imagej

#1

Hello There!

I have a problem with thresholding. I want to calculate the ratio between euchromatin (light pixels) and heterochromatin (dark pixels) in an 8 bit grey scal image stack.
This is the macro I use:

// Clean up the results table
run(“Clear Results”);

//run(“Threshold…”);
setAutoThreshold(“Default dark”);
//run(“Threshold…”);
setThreshold(90, 255);
setOption(“BlackBackground”, false);
run(“Convert to Mask”, “method=Default background=Dark calculate”);

// Fill holes is not necessary for nuclear lamina meassurements
// Fill holes to create a complete mask of the cell body
//run(“Fill Holes”, “stack”);

// Set the scale to how much pxs equal 1 µm
// has to be adjusted for each image stack!!!
run(“Set Scale…”, “distance=180 known=1 pixel=1 unit=”);

// Measure Stack

// This macro measure all the slices in a stack.

macro “Measure Stack” {
saveSettings;
setOption(“Stack position”, true);
for (n=1; n<=nSlices; n++) {
setSlice(n);
run(“Create Selection”);
run(“Measure”);
}
restoreSettings;
}

// von http://rsb.info.nih.gov/ij/macros/MeasureStack.txt

So if I change the grey values within the same threshold method (eg. Default) I always get the same meassurements. It doesn’t matter if the threshold is from 80-240 or 111-240 …I always get the same surface meassurement values!

Does anyone know how to fix this?

Thanks in advance!!!