Batch mode and Results window

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Batch mode and Results window

Pedro J CamelloDr Pedro J Camello
Hi all,

I need to open images in a folder and their matching files of multiple ROIs coordinates (several hundreds per image) to perform measurements.
A single macro works fine, but using setbatchmode(true) to make it faster, I do not get any Results window, and therefore I can´t access measurements. I have tried to place setbatchmode("show") or setbatchmode(true) at different places in the loop without success.
Is this normal? No access to Results window if setbatchmode is enabled?

My macro follows:
setBatchMode(true);
run("Set Measurements...", "mean redirect=None decimal=2");

//listaArchivos is an array containing my list of files
for (i = 0; i<listaArchivos.length;i++) {
        open(carpetaROIs + File.separator + ROIs[i]); //carpetaROIs and ROIs are the folder and the list of archive for the rois
        open(carpeta + File.separator + listaArchivos[i]); carpeta and listaArchivos are the folder and the list of images
         roiManager("Measure");
        close("ROI Manager");
        close("*");
       
}
 saveAs("Results", carpeta + File.separator + ROIs[i] + "_Histogra" + ".txt");

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Batch mode and Results window

Krs5
Dear Pedro,

I would say that is not normal. In batchmode you should get a results table, see macro code below.

setBatchMode(true);
run("Blobs (25K)");
setAutoThreshold("Default");
setOption("BlackBackground", false);
run("Convert to Mask");
run("Analyze Particles...", "add");
roiManager("Measure");

Is it possible that you close the ROI Manager before the measurements are finished? What happens if you run the macro till roiManager("Measure"); ?

Best wishes

Kees

-----Original Message-----
Sent: 04 May 2021 09:53
Subject: Batch mode and Results window

Hi all,

I need to open images in a folder and their matching files of multiple ROIs coordinates (several hundreds per image) to perform measurements.
A single macro works fine, but using setbatchmode(true) to make it faster, I do not get any Results window, and therefore I can´t access measurements. I have tried to place setbatchmode("show") or setbatchmode(true) at different places in the loop without success.
Is this normal? No access to Results window if setbatchmode is enabled?

My macro follows:
setBatchMode(true);
run("Set Measurements...", "mean redirect=None decimal=2");

//listaArchivos is an array containing my list of files for (i = 0; i<listaArchivos.length;i++) {
        open(carpetaROIs + File.separator + ROIs[i]); //carpetaROIs and ROIs are the folder and the list of archive for the rois
        open(carpeta + File.separator + listaArchivos[i]); carpeta and listaArchivos are the folder and the list of images
         roiManager("Measure");
        close("ROI Manager");
        close("*");
       
}
 saveAs("Results", carpeta + File.separator + ROIs[i] + "_Histogra" + ".txt");

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=04%7C01%7Ckrs5%40leicester.ac.uk%7C275753dca9be4ece88f108d90edb8d79%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C1%7C637557158401961910%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=UAm%2Bjk2Fau01b2u0Pj7wkSrfWE%2Bpf0XkbNA2GOxg3zg%3D&amp;reserved=0

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Batch mode and Results window

Krs5
Besides that, I think you want to have your saveAs command within the loop

Kees

-----Original Message-----
Sent: 04 May 2021 12:12
Subject: Re: Batch mode and Results window

Dear Pedro,

I would say that is not normal. In batchmode you should get a results table, see macro code below.

setBatchMode(true);
run("Blobs (25K)");
setAutoThreshold("Default");
setOption("BlackBackground", false);
run("Convert to Mask");
run("Analyze Particles...", "add");
roiManager("Measure");

Is it possible that you close the ROI Manager before the measurements are finished? What happens if you run the macro till roiManager("Measure"); ?

Best wishes

Kees

-----Original Message-----
Sent: 04 May 2021 09:53
Subject: Batch mode and Results window

Hi all,

I need to open images in a folder and their matching files of multiple ROIs coordinates (several hundreds per image) to perform measurements.
A single macro works fine, but using setbatchmode(true) to make it faster, I do not get any Results window, and therefore I can´t access measurements. I have tried to place setbatchmode("show") or setbatchmode(true) at different places in the loop without success.
Is this normal? No access to Results window if setbatchmode is enabled?

My macro follows:
setBatchMode(true);
run("Set Measurements...", "mean redirect=None decimal=2");

//listaArchivos is an array containing my list of files for (i = 0; i<listaArchivos.length;i++) {
        open(carpetaROIs + File.separator + ROIs[i]); //carpetaROIs and ROIs are the folder and the list of archive for the rois
        open(carpeta + File.separator + listaArchivos[i]); carpeta and listaArchivos are the folder and the list of images
         roiManager("Measure");
        close("ROI Manager");
        close("*");
       
}
 saveAs("Results", carpeta + File.separator + ROIs[i] + "_Histogra" + ".txt");

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=04%7C01%7Ckrs5%40leicester.ac.uk%7C5123c25a890c4b832ff608d90eed9b6c%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C1%7C637557235947403697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=migEWiPHmkMkSbSrazBDzTJiZqU4zViO6WGouktYuwE%3D&amp;reserved=0

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=04%7C01%7Ckrs5%40leicester.ac.uk%7C5123c25a890c4b832ff608d90eed9b6c%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C1%7C637557235947403697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=migEWiPHmkMkSbSrazBDzTJiZqU4zViO6WGouktYuwE%3D&amp;reserved=0

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html