renaming ROIs in batch mode?

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

renaming ROIs in batch mode?

Martin Höhne
Dear list,
I have a macro that runs on an image with DAPI stained nuclei. The nuclei are counted with the Nucleus Counter Plugin which adds a ROI for every nucleus to the ROI manager. This works fine.
In a second step the ROIs are enlarged a little bit and are renamed. This is quite slow since each ROI is drawn into the image as it is processed. Setting batch mode to true doesn´t work (am I doing something wrong?). If I do that before calling the plugin, the plugin won´t run. Doing it thereafter, I see no effect.
I there a possibility to do the ROI-enlargement and renaming without each ROI being displayed one after the  other?

Thanks for any suggestions,
Martin
(I´m running FIJI on winXP)


run("Nucleus Counter", "smallest=1000 largest=9000 threshold=Otsu smooth=None subtract watershed add show");
// ROIs are added to the ROI manager by the plugin

n = roiManager("count");
for (i=0; i<n; i++) {
        roiManager("Select", i);
        run("Enlarge...", "enlarge=4 pixel");
  roiManager("Rename", i+1);
  roiManager("Update");
}