Measuring thickness/width of the layer for multiple images

Hello everyone,

I am a beginner in ImageJ/Fiji and I am working on a project but I don’t know how to go ahead and solve my problem.

My issue:
I want to measure the thickness of a layer for multiple images (>1000). I add an image to describe my issue more understandable.

Image0319 14-31-37.bmp (1.2 MB)

I have to two ideas how to solve the problem. I dont know how to implement it or which idea is working.

  1. I draw a line along my sample and plot the profile. I get a peek on the position of the layer. If I measure the width of the peek I get the thickness of the layer.

  2. I do segementation to detect the different parts and the edges. Then I measure the distance between the edges.

I would be happy if someone could help me to solve my problems. I dont know if my ideas work.


If your images are 1000 images of the same sample over time, you could open them as a stack, draw a vertical line at the measurement location and reslice your xyt volume as a xt image from which it will be easier to get measurments.
Use the Image>Stack>Reslice command to do that.

1 Like

Hey @jerome ,
thank you for your response and the hint with reslice. With the reslice it is really easier to get mesaurement. But I do not really know how to go further.

I describe my issue more clearly:
I mark the thickness of the layer that I want to measure for multiply images. The position of the sample remains the same but the layer moves upwards.

Image0022 16-09-01.bmp (3.5 MB)
Image0099 16-28-16.bmp (1.2 MB)

When I do the reslice it would be easier to segementation to measure the width of the white layer. But I dont know how to segment.
Or I draw a line, plot the profile and measure the width of the peak. But I dont know how.

Maybe you have a better idea or could give me more hints.

Thanks again.

Best Pouyan

I do not have your data, but here’s a macro that simulates what I was suggesting. In the resliced image you see a x vs time image so the band thickness at any time point can be measured from the width of the bright pixels on the same line.

run("Fresh Start");
newImage("Untitled", "8-bit noise", 800, 400, 300);
setForegroundColor(255, 255, 255);
for(i=1; i<=nSlices; i++) {
    makeRectangle(268, 63+i, 153, 14+10*sin(i*PI/100)); // make line width vary
run("Select None");
run("Gaussian Blur...", "sigma=2 stack");
run("Line Width...", "line=30");
makeLine(342, 0, 342, 400);
run("Reslice [/]...", "output=1.000 slice_count=1");
run("Find Edges");
run("Line Width...", "line=1");
makeLine(0, 100, 800, 100);
run("Plot Profile");


1 Like

Hey Jerome, thank you for your help. I tried to understand your script step by step but I didnt come further.
Which data do you need? Just Images?
I import my images via batch → macro and run this code but didnt get any results.
My question step by step:

  • the command Fresh Start didnt work, but I see that it is not important.
  • If I import my images as batch, do I need the 2. row: newImage? What is this row?
    1. row: should I keep the values? Or should I change them?
    1. row: what does Gaussian Blur mean?

So you see that I am not really familliar with that.
You dont have to answer all my question clearly.
I dont really understand what the code does and what should I change for my case because I didnt get any results. I just change the line.
For example I got an error for the Reslice [/] row

I would be happy if you can help me as far you can.

Thank you

best pouyan

1 Like

That’s OK, I’ll try to give you more clear steps to achieve that.

  • Place all your files for one image sequence in a new folder.
  • import them all as a virtual stack with File>Import>Image Sequence.
  • draw a line on your image that crosses the band you want to monitor.
  • give that line a width by double clicking the line tool
  • close the line Width frame and run the reslice command from Image>Stacks>Reslice [/]
  • you will get an xt image with each line taken from a profile in a slice from the virtual stack
  • from this image, you should be able to track position and thickness of the white band.


1 Like

Hey Jerome,

thank you for your explanation step by step. It really helps a beginner like me to understand better the script you sent me before.
It is everything clearly and I understand the steps and the result I get with the reslice. Thank you again.

Now the most important part, measuring the width and position of the white band.
As you say, every line considers to an image.

I am thinking about how to measure the width and the positions and I have no idea, cause I have to draw a line for every step.
Additionally, what is the best way to measure mine the width? Determine the lower and uper edge? Is there a simple and faster way?

Sorry for so much asking you

You save me, thank you Jerome.


Topic solved by Jerome

Thanks for the image.
From there, I suggest you draw two splines with the segmented line tool and add them to the ROI Manager. I’m including a sample as an example. (441 Bytes)

After you adjusted the splines to the data, run the attached macro.
macro.txt (875 Bytes)

It will output a table with measurements of x positions of the lines and interval (thickness) between them. It also creates a graph to give you an idea, but you can export the Table as csv and process it further if you need.

Time is in time elapsed after (n) images.
Thickness is in pixel unit

Please post this as an answer in the main thread if it solves your issue, so others can learn from this.