Login  Register

Re: Analyzing a grid of ROIs

Posted by Richard Mort-2 on May 10, 2013; 8:14am
URL: http://imagej.273.s1.nabble.com/Analyzing-a-grid-of-ROIs-tp5002945p5002967.html

Hi Ben,
If you need an example of a macro that can iterate though a grid of ROIs
and measure/do stuff to each then this may help:

http://imagejdocu.tudor.lu/doku.php?id=macro:tiled_autofocus_hyperstack

Cheers
Rich


On 09/05/13 18:20, Ben Tupper wrote:

> Hi,
>
> On May 7, 2013, at 2:18 PM, Audrey O'Neill wrote:
>
>> Hello -
>>
>> Does anyone have experience with anaylzing a grid of square ROIs according to mean gray values?
>>
>> Basically, I am trying to quantify how sorted or patchy a given field of cells (half of which are stained for GFP) is, using nearest-neighbor analysis.
>>
>> The method is described in more detail in this paper (http://www.ncbi.nlm.nih.gov/pubmed/9520108?dopt=Abstract), but basically what we want to do is:
>>
>> 1. divide the image into a grid of squares with height and width approximately equal to cell diameter
>> 2. find the mean gray value of the whole image and set it as the threshold
>> 3. count each square as above or below the threshold
>> 4. count how many of each "above threshold" square's nearest neighbor squares (above, below, left, and right) are above threshold
>>
>> I can do step (1) using a variant of the macro found here (http://imagej.1557.x6.nabble.com/How-to-create-a-regular-grid-of-rectangular-ROI-s-td3685056.html), and step (2) is fairly trivial, but I am totally lost when it comes to steps (3) and (4).
>>
> You might be able to adapt the RATSQuadtree class in the RATS_ plugin - see http://rsb.info.nih.gov/ij/plugins/rats/index.html  Once the quadtree is set up, you can query any 'leaf' to compute stats about the companion image within each 'leaf'.  My memory of it is fuzzy enough that I don't recall if it will require a lot of tweaking to enforce square leaves - I think it is set up now to subdivide based upon a suggested minimum leaf size so you may end up with rectangles rather than squares.
>
> Cheers,
> Ben
>
>
>
>
>
>> Thanks very much!
>>
>> Audrey
>> Postdoc, Bush lab
>> Cell and Tissue Biology
>> UCSF School of Dentistry
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
Dr Richard Mort
MRC Human Genetics Unit
MRC IGMM
University of Edinburgh
Western General Hospital
Crewe Road
Edinburgh.
EH4 2XU, UK

Tel: +44 (0)131 332 2471
Fax: +44 (0)131 467 8456


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

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

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