How to separate a ribbon from edges of a cell with imagej/fiji?

Lets assume we have an image of a single cell. The boundaries are determined by free hand section or another plugin. Now, I need to separate a ribbon from edges of the cell and do some further analysis. The ribbon is separated from the edges with a predetermined length (like the image).
Is there any plugin that can do it for me?
I attached the schematic image of what i want for more clarification.


You can combine the following two commands:

  • Edit > Selection > Enlarge… with a negative value
  • Edit > Selection > Make Band…

Try the following macro from the script editor:

#@ Integer width

run("Enlarge...", "enlarge=-"+width);
run("Make Band...", "band=&width");

Is width the arbitrary value?

@Zeynab_Mousavi Check this out:


This works only with segmented line. My edges are like polygons.

Yes, that’s one of the limitations.

I am curious, what kind of further analysis do you want to perform?


I will be using a plugin (LPX) for actin fibers calculations.

Does the plugin require a ribbon ROI (a donut shaped area), or will it also work on a broken donut shaped area? If it’s the latter, then you could draw a segmented line all along your cell and get the desired area ROI (broken donut) by running my macro. Depending on how close you position the start and end points of the segmented line, you will only be loosing a very small area of the ribbon.


I need to do it for many images so I need an automated method.

have you tried?
I think that the little script suggested by @imagejan does exactly what you were asking.


I agree with @emartini. The script suggested by @imagejan is what you need.

And width is a variable, which you need to decide.


@vedsharma @emartini @imagejan
What is the difference between the 1st and second line? And what is the unit of width?is it pixels?

Please go through ImageJ documentation. You will find your answers there. In particular, the following section:


1 Like

@vedsharma @imagejan @emartini is there any way to measure intensity of red pixels in the ribbon?
and also can imagej calculate the surface area of that ribbon?