Creating ROI`s automaticly in FIJI

Hello to all!
I have a question?
I need to make a ROI’s ( region of interest) for every parcel which contain 4 rows on my agricultural trial. Now im making those ROI’s in FIJI one by one, which is time consuming, so is there any way that i can do this automatically. Can some software recognize my parcel that it contains 4 rows of plants and make it first ROI automatically and after that all others?
Thank you for your answers!!

Hi @peda,

You might want to check out this macro. It could be easily modified to provide you with a reasonably approximate roi layout.


Hi @NicoDF,
Thanks a lot for your help! Your macro is good but i was thinking about something else, i need a macro which will make a ROI based on difference between soil and plants rows.



Could you please provide an example of the type of ROI you’re after, using the posted image?
I thought you were looking for ROIs that would completely cover each block of four rows, regardless the fact that some rows have missing plants.

Sure, on the image you can find the example of ROIs that i manually create. My image is not perfectly stitched so that can also may be a problem for automatically crating ROIs.

Here’s a function I wrote for just this reason. It adds the current selection to the ROI Manager and appends the zero based index.


function roiadd(name) //Helps organize the roi’s
roiindex = roiManager(“count”) -1;
roiManager(“select”, roiindex);
roiManager(“rename”, name+" - "+roiindex);


I share with you a 2D coronal view of a skull that present a bone defect(s) in the middle. On the slide, the bone is in black, the background in white and the soft tissue in blue. My goal is to characterize the porosity within the bone. Therefore, I need to select the bone with its holes in it from the background.

As Peda, I have been trying to create ROI that select bone (black colors) with the porosity inside (different size holes).

I attempted to performed it automaticaly with the fonction “color threshold…” but the selection does’t include the porosity in the bone (cf images) :
// If the brightness is low, it allows a proper delimitation of the bone area but the threshold doesn’t include the porosity in the bone.
// If I increase the brightness (up to 236 for exemple), the delimitation of the ROI include soft tissue outside of the bone.
// I tried to use the fonction “fill ROI holes” but it doesn’t work (the fonction “fill holes” from my mask works but it doesn’t help me a that stage).

Therefore, I attempted to use the fonction “Trainable Weka segmentation” but I have not been able to create a ROI from the training result.

Could you help my on that, please ?

CCC3. ROI _color Threshold_Bright236.tif (10.8 MB) CCC3. ROI _color Threshold_clearoutside.tif (11.1 MB) CCC3. ROI color Threshold.tif (10.8 MB) CCC3.VK15_5.0x(1)-1.tif (RGB).tif (10.8 MB)