Measuring mulitple species from a single image

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

Measuring mulitple species from a single image

gaton
Hello,
I'm trying to measure (area), categorise (as species) and count multiple individuals from a single image. E.g. image of a fouling community with multiple individuals of different species- I want to know how many species, how many individuals of each species, and area covered by each species or individual.
I'm using the Wand tool to select the individuals as ROIs- adding these to the ROI manager. I could then rename them as species, measure, export the results to excel and count from there. But I'm wondering if there is some way to automate the naming- e.g. have 10 species each assigned to a number key and when I press that key it renames the most recent ROI (I'll panic when I go over 10 species, but you get the gist). Or- using different colors to highlight the different species and then somehow recording the selection color as a column in the measurement results (again, export to excel & count colors from there).
I've also added ObjectJ which does most of the above, except I can't use the wand tool from within ObjectJ.


Does anyone have any suggestions of a work-around?

Thanks,
Gail
Reply | Threaded
Open this post in threaded view
|

Re: Measuring mulitple species from a single image

Olivier Burri
Dear Gail,

> automate the naming- e.g. have 10 species each assigned to a number key and
> when I press that key it renames the most recent ROI (I'll panic when I go over
> 10 species, but you get the gist). Or- using different colors to highlight the
> different species and then somehow recording the selection color as a column in
> the measurement results (again, export to excel & count colors from there).

This is indeed doable probably but could you provide us with an example image?

The fact that you can use the magic wand sort of hints that a more automatic segmentation could be possible.

All the best

Oli

Olivier Burri
Engineer - Image Processing
& Software Development
EPFL - SV - PTECH - PTBIOP

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

Re: Measuring mulitple species from a single image

vischer
In reply to this post by gaton
Hello Gail,

> On 11. Jul 2014, at 21:51, gaton <[hidden email]> wrote:
>
> Hello,
> I'm trying to measure (area), categorise (as species) and count multiple
> individuals from a single image. E.g. image of a fouling community with
> multiple individuals of different species- I want to know how many species,
> how many individuals of each species, and area covered by each species or
> individual.
> I'm using the Wand tool to select the individuals as ROIs- adding these to
> the ROI manager. I could then rename them as species, measure, export the
> results to excel and count from there. But I'm wondering if there is some
> way to automate the naming- e.g. have 10 species each assigned to a number
> key and when I press that key it renames the most recent ROI (I'll panic
> when I go over 10 species, but you get the gist). Or- using different colors
> to highlight the different species and then somehow recording the selection
> color as a column in the measurement results (again, export to excel & count
> colors from there).
> I've also added ObjectJ which does most of the above, except I can't use the
> wand tool from within ObjectJ.
>
>
> Does anyone have any suggestions of a work-around?
>
> Thanks,
> Gail

You can look at this ObjectJ example which uses shortcut keys to create outlines of different categories and sorts the results into different columns.
http://simon.bio.uva.nl/objectj/examples/RoiCounter/MD/roicounter.html

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

Re: Measuring mulitple species from a single image

gaton
In reply to this post by Olivier Burri
Hi Oli,
Thanks for the offer of help.
Hopefully I can describe that I don't think an automatic segmentation using colour/size/shape would work. For example, 2 species of spirorbid (an encrusting worm that builds white calcareous tubes) are essentially white spirals on the surface. The only way to tell them apart is to note whether they spiral clockwise or anticlockwise. A third species may have ribs or ridges along the dorsal surface. And a fourth white roundish spot may just be a particle of detritus/something that drifted into the photo.
I could use colour segmentation to highlight all white spots, but at that point it's probably just as easy for me to scan the image by eye- also picking up all red spots that are actual organisms while skipping all red spots that are just urchin tube feet that they've left behind... counting the number of zooids in a particular colony, etc.

I'll have a look at Norbert's suggestion below & let you know if successful.
Thanks,
Gail
Reply | Threaded
Open this post in threaded view
|

Re: Measuring mulitple species from a single image

Olivier Burri
Hi Gail,

What I was thinking was not an automatic classification but an automatic segmentation:
Step 1: Find all objects of interest on image (This part could be automated)
Step 2: Program presents each ROI to you so you can classify it (Manually With keyboard shortcuts, voice commands, number of eye blinks, whatever you want :)

Sorry if my first message was not so clear.

All the best and indeed I hope that as per Norbert's suggestion, ObjectJ can do what you need.

Oli

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

Re: Measuring mulitple species from a single image

gaton
In reply to this post by vischer
Hi Norbert,
The description of ROIcounter on the link you sent sounded perfect. Either I am not using it correctly, or I misinterpreted the description. I thought I would be able to hover over ROIs I had already created using the Wand, press [1] and have them stored as Object Type1. But instead, I have to select Type1, then still draw around the ROI using the ObjectJ Marker Tool in order to define the area.
The problem with the ROIcounter/Cellcounter in ObjectJ is that you have to manually draw around the ROI- not select it using the wand tool- which is much more accurate for outlining an individual (given my mouse manipulation skills).
Any other suggestions?
Thanks,
Gail
Reply | Threaded
Open this post in threaded view
|

Re: Measuring mulitple species from a single image

gaton
In reply to this post by Olivier Burri
Hi Oli,
If you know a way to make Step 2 happen, that would solve my problem.
Thanks,
Gail
Reply | Threaded
Open this post in threaded view
|

Re: Measuring mulitple species from a single image

Straub, Volko A. (Dr.)
In reply to this post by gaton
Dear Gail,

Here is a little macro that might be useful to you. It doesn't use the
ROI - instead it creates a new image and colour codes the selected shape
based on the number key that you click. In order to use it, copy the
code to the script editor and install the macro. Once it is installed,
make a selection with the wand tool (or any other selection tool you
would like to use). When you are happy with your selection, press a
number (currently any value between 1 and 5 - to extent it simply copy
the macro "shapeX [X]"{addShape(getTitle(),X);} part and replace X with
additional numbers).
The first time you do this, the macro will create a new black image with
the original image title + Shapes. It will then add the selected region
to the new image and colour it according to the key you pressed
(currently 10 for key 1, 20 for key 2, etc - but you could change this
easily).
When you select a second region and press a key between 1 and 5, that
region will be added to the shapes image, and so on.

When you have gone through all your particles of interest, you can then
simply use a small loop to threshold the image to select individual
types (i.e. all shapes with a value of 10, etc) and use the particle
analyser to count and measure these shapes.

Hope this is of some use,
Volko


macro "shape1 [1]"{
     addShape(getTitle(),1);
}
macro "shape2 [2]"{
     addShape(getTitle(),2);
}
macro "shape3 [3]"{
     addShape(getTitle(),3);
}
macro "shape4 [4]"{
     addShape(getTitle(),4);
}
macro "shape5 [5]"{
     addShape(getTitle(),5);
}


function addShape(image,type){
     if (!isOpen(image+"_Shapes")){
         selectImage(image);
         getDimensions(width, height, channels, slices, frames);
         getPixelSize(unit,pixelWidth,pixelHeight);
         newImage(image+"_Shapes","8-bit black",width, height,1);
         setVoxelSize(pixelWidth, pixelHeight,1, unit);
     };
     selectImage(image+"_Shapes");
     run("Restore Selection");
     changeValues(0,255,type*10);
     selectImage(image);
}


On 15/07/2014 18:57, gaton wrote:

> Hi Norbert,
> The description of ROIcounter on the link you sent sounded perfect. Either I
> am not using it correctly, or I misinterpreted the description. I thought I
> would be able to hover over ROIs I had already created using the Wand, press
> [1] and have them stored as Object Type1. But instead, I have to select
> Type1, then still draw around the ROI using the ObjectJ Marker Tool in order
> to define the area.
> The problem with the ROIcounter/Cellcounter in ObjectJ is that you have to
> manually draw around the ROI- not select it using the wand tool- which is
> much more accurate for outlining an individual (given my mouse manipulation
> skills).
> Any other suggestions?
> Thanks,
> Gail
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Measuring-mulitple-species-from-a-single-image-tp5008690p5008750.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: Measuring mulitple species from a single image

vischer
In reply to this post by gaton
Hi Gail,

the idea was that you need not to use the wand at all. Instead, locate the cursor without clicking the mouse, then press the key [1], [2] or [3]. It will  create the roi (just as the wand would do), and directly converts it into an object of the desired type.

Make sure not to mark the same roi twice, as two equivalent rois above each-other are only distinguishable by the superimposition of two different number labels.

regards, Norbert
On 15. Jul 2014, at 19:57, gaton <[hidden email]> wrote:

> Hi Norbert,
> The description of ROIcounter on the link you sent sounded perfect. Either I
> am not using it correctly, or I misinterpreted the description. I thought I
> would be able to hover over ROIs I had already created using the Wand, press
> [1] and have them stored as Object Type1. But instead, I have to select
> Type1, then still draw around the ROI using the ObjectJ Marker Tool in order
> to define the area.
> The problem with the ROIcounter/Cellcounter in ObjectJ is that you have to
> manually draw around the ROI- not select it using the wand tool- which is
> much more accurate for outlining an individual (given my mouse manipulation
> skills).
> Any other suggestions?
> Thanks,
> Gail
>

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