Anyway to scale down the edges of the cell in imagej macro language?

I have detected the edges of the cell in a single cell image and I need to scale down those edges for example to form a boundary which is 80% of the current cell edge.
image
for example in this image I have edges of the cell (outer blue line) and I need inner boundary shown automatically.
I know I can use these functions: run(“Enlarge…”, “enlarge=-”+50);
run(“Make Band…”, “band=”+50);
but I want to work with percentage not with pixels/points.
I need something similar to this function in matlab:
https://www.mathworks.com/help/matlab/ref/polyshape.scale.html
Is there anyway in imagej/fiji macro language?

On the selection run Edit > Selection >Scale.
Here you can work with percentages as decimal values. For the make band that is not possible but based on the selection size it should be possible to calculate the pixel numbers for the band from a desired percentage.

2 Likes

@biovoxxel what you mean by " On the selection run Edit > Selection >Scale." ? As far as I know Edit > Selection >Scale is for setting the scale of the image so that pixels are converted to length (like um).

Hey @Zeynab_Mousavi,

this menu scales a selection. Give it a try :wink:

Cheers,
Robert

2 Likes

Hi @Zeynab_Mousavi,

Nop. Setting the scale of an image is under ►Analyze ►Set Scale… :wink:
As @haesleinhuepf points out… make a selection and try the command

hth

2 Likes

@biovoxxel @haesleinhuepf thanks so much for your help. I will try and get back to you.

Hi! The post was tagged as CellProfiler too, so I can add that in CellProfiler, after running an Identity module to find the cell borders, you would use the ExpandOrShrink module to shrink those borders by a defined amount.

That will create shrunk cells. If you also want to define the resulting ring shape in order too measure its properties, you’d use IdentifyTertiaryObjects to subtract the shrunken cell from the original cell.