Measuring cell wall intensity after thresholding and redirect seems wrong

Hi,

I am trying to measure the mean intensity of cell walls of Arabidopsis fluorescence cross section in order to create a plugin (lsm file). However the Results file always delivers the identical numbers even if I don’t redirect or use different thresholding methods. Here is a record of my pipeline.

selectWindow("r1s5-4.lsm");
run("Duplicate...", "  channels=1");
setOption("ScaleConversions", true);
run("8-bit");
run("Auto Threshold", "method=Huang white");
run("Set Measurements...", "area mean integrated area_fraction limit display redirect=r1s5-4.lsm decimal=2");
run("Measure");

Thanks for the help,
Guy

based on off-Forum discussion with Herbie (thank you Herbie!) I used this code:
Note, each lsm file has 2 channels, channel 1 is the fluorescence and channel 2 is a bright field

run(“Set Measurements…”, “area mean integrated area_fraction limit display redirect=None decimal=2”);
selectWindow(“r1s5-4.lsm”);
setSlice(1);
setAutoThreshold(“Huang dark”);
//setAutoThreshold(“Minimum dark”);
run(“Measure”);
resetThreshold();

This would be the final macro:

//a pipeline to identify and measure root cell wall intensity perm um or pixel

dir1=getDirectory(“Get Directory”);
list=getFileList(dir1);
file="/output_herbie/"
prefix=“r”
measure = dir1 + file;
File.makeDirectory(measure);

for(i=0;i<list.length;i++){
if(startsWith(list[i], prefix)){

showProgress(i+1, list.length);
open(dir1+list[i]);
run(“Duplicate…”, “duplicate channels=1”);

run(“Set Scale…”, “distance=4.6160 known=1 pixel=1 unit=µm”);

run(“Set Measurements…”, “area mean integrated area_fraction limit display redirect=None decimal=2”);
//selectWindow(“r1s5-1.lsm”);
setSlice(1);
setAutoThreshold(“Default dark”);
//setAutoThreshold(“Minimum dark”);
run(“Measure”);
resetThreshold();
close("-");}
}
name = File.getName(dir1);
selectWindow(“Results”);

saveAs(“txt”, measure+“Results”);

And this a macro with a local threshold that, seems that the function “measure” cannot have a redirect option but “Analyze particles” can. To get the grey_scale/pixel one needs to sum the IntDen for each image and divide by the sum of the area of each image.

//a pipeline to identify and measure root cell wall intensity per pixel

dir1=getDirectory(“Get Directory”);
list=getFileList(dir1);
file="/output_raul/"
prefix=“r”
measure = dir1 + file;
File.makeDirectory(measure);

for(i=0;i<list.length;i++){
if(startsWith(list[i], prefix)){

showProgress(i+1, list.length);
open(dir1+list[i]);

original_file_name = File.name;
ch1_name=“C1-”+original_file_name;

run(“8-bit”);
run(“Split Channels”);
//run(“Set Scale…”, “distance=4.6160 known=1 pixel=1 unit=µm”);
close(“C2*”);

duplicated_file_name = File.nameWithoutExtension;
run(“Duplicate…”, “duplicate title=&duplicated_file_name”);

run(“Mean…”, “radius=2”);
run(“Auto Local Threshold”, “method=Bernsen radius=20 parameter_1=0 parameter_2=0 white”);
run(“Set Measurements…”, “area mean integrated display redirect=[&ch1_name] decimal=2”);
run(“Analyze Particles…”, “pixel show=[Overlay Masks] display exclude in_situ”);
saveAs(“jpeg”, measure+getTitle);
close("-");}
}
name = File.getName(dir1);
selectWindow(“Results”);
//print(dir1);
//print(name);
saveAs(“txt”, measure+“Results”);