Plot profile area selection


I’m using the plot file to measure the fluorescent intensity of my sample, and I found it’s inevitable to include the background since the plot profile requires line or rectangle selection. Like this in the image below, the black part is also included.
Capture Capture2
This is just part of the sample, so rotation cannot solve the problem to exclude the background. And the background included in the selected area is affecting the gray value here, the curve shape remains the same, but the Y value differs.

I’ve tried to use photoshop to make the background transparent, doesn’t work, background still counts in the gray value.
Could someone tell me if there’s a way to only measure the sample area in the plot profile? Or if I use the rectangle of the same size, then the results will be comparable?


Dear Yujia,
You can either remove the background of the image manually by setting the intensity values to zero or get an average intensity of the sample automatically through some threshold.
To change the background value manually, you just select the background and turn the Brightness down:

At this point, you can just plot normally:

Another option is to threshold your image and get the average intensity from the area with the sample.
To do this, select Process->Binary->Make Binary


After you have thresholded the image, select Analyze -> Analyze Particles... and set Show: to Outlines and click okay.


You next need to pull up the original image and select Image-> Overlay -> From ROI Manager and then select Measure in the ROIManager. This will give you the average intensity in the sample.


Hi @SpencerLab
Thank you for your quick and detailed reply!
For the first method, when I manually selected the background and managed to turn the Brightness down, I got the plot file like this:
But I found under this condition, still the more background included, the lower the gray value is.
Capture2 Capture1
Is the gray value calculated by the area?
And I successfully used the your method to outline the sample, but is it possible to use the Plot Profile to measure the ROI? Because I also want to show the intensity changing trend along the axis.


1 Like

Dear @Yujia
The plot profile is generated by averaging the values of each column specified by the ROI from the left to right. In your earlier pictures:


your sample if orientated vertically, and in the later image:


the sample is orientated horizontally. These means that in the horizontal image, the plot profile includes more background values when it calculates each point of the profile. This is why your values are decreasing as you increase the size of the ROI on the horizontal image.

I see, thank you for the explanation!
By the way, do you know about other methods to measure the fluorescent intensity changing trend along a non-straight axis using ImageJ?

Dear @Yujia
Instead of using the rectangle select, you can try use the freehand line select. This can get a plot profile from a non-straight line.

Thanks! I haven’t made myself clear, I still want to measure the changing trend of the whole area, not only a single line along the axis, yet the Plot Profile can only be selected by line or rectangle. But I assume that a fixed size of rectangle will make the results comparable, since the sample sizes are similar, the background included should be similar as well.
I’d like to hear your advice.


Dear @Yujia
I would be concerned that your average values will change depending on how much blank space you include when drawing your ROI. You could potentially adjust the line width until it is the size of the line covers the sample. Double click the Line Option to open the Line Width option.
I also double checked the documentation for the plot profile function, and it look like clicking Alt + SHIFT + K will calculate the intensity in the horizontal direction rather then the vertical direction. So you could rotate the image and apply a rectangle ROI perpendicular to sample.
Here is an example:
Ctrl + K:


ALT + Ctrl + K:


Dear @SpencerLab
Thank you so much for your advice! I found that adjusting Line Width really helps with covering most of the sample, and that will reflect a much more accurate value. Also I noticed the vertical and horizontal problem of the plot profile and made sure it’s measured along the right axis when using rectangle.

1 Like