Isolating Analysis Area

I need to count the number of strips as shown in the picture below. However I am having trouble isolating the target area.

First Attempts
I tried drawing a line across the entire image and creating a plot profile (Analyze-> Plot Profile). I then saved the data and exported it into excel where I analyzed the differences between neighboring pixels to determine a change in color (and thus a new strip). This however led to inaccurate results.

I am relatively new to imagej so I am still trying to learn its capabilities but is there an easier (and more accurate) way to do this?

Hi @cameronkennedy9406

One possibility is to filter the image with a Gaussian Blur filter to suppress high frequencies (e.g. small differences caused by image noise, edges or shadows. In the image you presented this was sufficiently possible by using a Gaussian Blur with a radius/sigma of 4.
Thereafter, the FindPeaks Tool from Norbert Vischer actually serves very well. You just need to draw a horizontal line and specify an appropriate tilerance in the options (I tested e.g. 15 which seemed to work fine). Activating dark background in the options will shift the peak finder to the bright areas if you rather want to indicate those ones. And at both ends of your image you have to take kare that you are not counting one too much if the line overshoots too much.

This is similar to your attempt a rather manual method. If you need to analyze many images one should think about a potential automation, which will (after some pre-processing) surely also be possible.

You could additionally do a (pseudo)-flat-field correction of the image to correct for the shading artifacts which you detect by looking at the line profile which shows a clear tendency to drop from left to right.
This would look like the following image (left before, right after the correction):

One possibility to achieve this is the pseudo-flat-field correction from the BioVoxel toolbox

Hope this helps you further.


Hi @biovoxxel,

Thank you so much for your response, this is exactly what I am trying to do. Finding the peaks with the FindPeaks Tool will suffice for my needs for now but I’ve downloaded the BioVoxtel toolbox for future projects!

I plan on placing a “boarder” around the region of interest (by using a sharpie, simple but effective I hope) to prevent miscounts due to stray strips. I also encountered double counts at the end strips so I am going to perform a DeltD analysis to weed out any peaks that are close together, and thus a double count. (DeltaD < ~10 ).

I need to analyze roughly 100 photos so the next step I need to figure out is how to automate the process! Thanks again for such a clear and helpful response!


For the interest of others searching for this topic:

The same question was asked on and was answered with a solution using OpenCV.

1 Like