Shape recognition and aspect ratios

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Shape recognition and aspect ratios

Johanna
Hallo,

Is it possible with ImageJ to measure the aspect ratio of only rounds features (the maximum radius/the minimum radius) in a picture that also contains non round features? I attached a part of that picture.

i am very grateful for any help, as the picture contains some hundrets of these round features.

Sample.png



Thanks a lot,

Johanna
Reply | Threaded
Open this post in threaded view
|

Re: Shape recognition and aspect ratios

Romain Guiet
Hi Johanna,
an easy way would be to split the image into independant channels and to save each channel as sequence...
I hope it would help you,
Romain

---------------------------------------------------------------
Dr. Romain Guiet
Bioimaging and Optics Platform (PT-BIOP)
Ecole Polytechnique Fédérale de Lausanne (EPFL)
Faculty of Life Sciences
Station 19, AI 0140
CH-1015 Lausanne

Phone: [+4121 69] 39629
http://biop.epfl.ch/
---------------------------------------------------------------

________________________________________
De : ImageJ Interest Group [[hidden email]] de la part de Johanna [[hidden email]]
Envoyé : mardi 21 avril 2015 06:02
À : [hidden email]
Objet : Shape recognition and aspect ratios

Hallo,

Is it possible with ImageJ to measure the aspect ratio of only rounds
features (the maximum radius/the minimum radius) in a picture that also
contains non round features? I attached a part of that picture.

i am very grateful for any help, as the picture contains some hundrets of
these round features.

Sample.png <http://imagej.1557.x6.nabble.com/file/n5012544/Sample.png>



Thanks a lot,

Johanna



--
View this message in context: http://imagej.1557.x6.nabble.com/Shape-recognition-and-aspect-ratios-tp5012544.html
Sent from the ImageJ mailing list archive at Nabble.com.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Shape recognition and aspect ratios

Michael Schmid
In reply to this post by Johanna
Hi Johanna,

The first steps are not too difficult, but then it becomes tricky.

First you have to convert the image to grayscale and filter it a bit, so you can get at least some reasonable threshold. I suggest edge-preserving blur like the 'Thresholded blur'
  http://imagejdocu.tudor.lu/doku.php?id=plugin:filter:thresholded_blur:start
(Alternatively, if you have Fiji, you could try segmentation by the Trainable Weka Segmentation.)

Then threshold it; select the threshold such that you don't miss many pixels inside the round particles (except 'holes' not connected to the periphery), but without selecting to many particles touching the round ones.

After applying the threshold, get rid of 'holes' in the particles (Process>Binary>Fill Holes) and run Watershed segmentation (Process>Binary>Watershed) to split off at least some extra particles that have merged with the round ones.

The problem is that some round particles still have 'attachments' seemingly protruding from them.
Without that complication, you could run 'Analyze particles', with suitable size range (very small particles are not circular, it seems) and some minimum circularity (e.g. 0.7).
With a macro or in a spreadsheet, can then select particles in the Results, e.g. if 'major' and 'Minor' (from 'Fit Ellipse' in the measurement options) have a suitable ratio, if the perimeter fits what you expect from such an ellipse, whether the min & max Feret diameters fir the minor and major axis, etc. The round particles also have high Roundness and high Solidity (from Set measurements> Shape descriptors).
  http://rsb.info.nih.gov/ij/docs/guide/146-30.html#sub:Set-Measurements...

It is helpful to have 'Analyze Particles' show the 'Overlay Outlines', so you can correlate the particle number with the number in the Results Table.

Another option would be 'Analyze particles' adding particles to the ROI manager, then having a macro to loop over the rois: for each roi, fill it in a separate image, then Edit>Selection>Fit Ellipse and get the statistics for the roi to see how many foreground pixels the particle has in the best-fit ellipse. The more, the closer it comes to an ellipse. Clear the image for the next roi.

Of course, an egg-shaped particle that it is more rounded on one side than on the opposite side (like the big one above the center in the sample image) is not a perfect ellipse. You will need some trial&error to get it right.


Hope it helps at least a bit...

Michael
________________________________________________________________
On Apr 21, 2015, at 06:02, Johanna wrote:

> Hallo,
>
> Is it possible with ImageJ to measure the aspect ratio of only rounds
> features (the maximum radius/the minimum radius) in a picture that also
> contains non round features? I attached a part of that picture.
>
> i am very grateful for any help, as the picture contains some hundrets of
> these round features.
>
> Sample.png <http://imagej.1557.x6.nabble.com/file/n5012544/Sample.png>  
>
>
>
> Thanks a lot,
>
> Johanna

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Shape recognition and aspect ratios

Johanna
In reply to this post by Romain Guiet
Thanks a lot for the detailed suggestions! :)