Question

Hello to all from Slovenia!

My issue: I am running particle analysis in different ROI using the following macro:

id = getImageID();
for (i=0 ; i<roiManager("count"); i++) {
    selectImage(id);
    roiManager("select", i);
    run("Analyze Particles...", "size=0.008-Infinity circularity=0.00-1.00 show=Outlines display");
}

What bothers me is that I get all results in one output file. I need each ROI in separate file (so I will be able to open it later in R). So, I would appreciate any suggestion, how can I change macro in order to get each results of ROI particle analysis in different file (Outlines and result table).

Thank you, Jerry

Était-ce utile?

La solution

In your previous question, I had edited my answer to include the following additional explanations:

  • You get the name of the current ROI using Roi.getName() that you can use to name the results file:

    current = Roi.getName();
    saveAs("Results", "/path/to/results/Results_" + current + ".txt");
    
  • Alternatively, you can include the current ROI name in each line of your results by checking Display label in the Analyze > Set Measurements... dialog, resulting in a macro command similar to this:

    run("Set Measurements...", "area display redirect=None decimal=3");
    

Please see the macro language documentation and the ImageJ mailing list archives before posting any new questions related to ImageJ macros.

To save the outlines, you can save the resulting image accordingly, naming it from the ROI name.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top