Login  Register

3D objects counter in batch mode?

Posted by S.T.Ligthart on May 22, 2006; 2:26pm
URL: http://imagej.273.s1.nabble.com/3D-objects-counter-in-batch-mode-tp3702719.html

Dear all,
 
Recently, I have started to work with the 3D objects counter plugin from
Fabrice Cordelières and with great pleasure. At this moment, I would
like to process multiple ics-files (3 channel image stacks) from a
directory to do a fast batch-count. However, when I use the
“setBatchMode(true)” command, my objects are not counted anymore. No
error message appears.
 
I use ImageJ 1.35p on a Linux server with suse 9.2 and the proper Java
installed. Below is a part of my code. It runs perfectly when I set the
setBatchMode command as comment (with //), but otherwise gives count of
0. I changed the 3D objects counter plugin a little bit: it prints the
number of particles and some more information to the log. Thus, I can
see that in normal mode particles are counted and in batch mode a count
of 0 is returned. Could it be that in batch mode the plugin does not
receive the proper image?
 
dir_ics = getDirectory("Choose main directory to analyze");
list_dir_ics= getFileList(dir_ics);
setBatchMode(true);
path_file_ics = dir_ics+list_dir_ics[0];
open(path_file_ics);
index_slash = lastIndexOf(path_file_ics, "/" );
index_dot = lastIndexOf(path_file_ics, "." );
icsfileName=substring(path_file_ics, index_slash+1, index_dot);
for (k=1; k<4; k++) {
            cur_ch = icsfileName + " ch: "+d2s(k,0); ;
            selectImage(cur_ch);
            run("8-bit");
            run("Make Montage...", "columns=1 rows="+nSlices+1+" scale=1
first=1 last="+nSlices+1+" increment=1");
            rename("Montage Stack");
            run("MultiThresholder", "Entropy");
            getThreshold(lower, upper);
            print(upper);
            close;
            selectImage(cur_ch);
            run(" 3D objects counter3", "threshold="+upper+" slice=5
min=50 max=500");
}
 
Anyone any idea?
 
Thanks!
 
Sjoerd Ligthart
University of Twente
 
Ps. I really enjoyed the conference, many thanks to the organizers and
speakers!