Login  Register

Re: Calculate area on a per object basis

Posted by Avital Steinberg on Sep 09, 2015; 7:15pm
URL: http://imagej.273.s1.nabble.com/Calculate-area-on-a-per-object-basis-tp5014278p5014296.html

Yes - this is exactly what I meant: iterate over the red objects, set the
threshold and segment the green particles within the red particles.

Good luck,
Avital

On Wed, Sep 9, 2015 at 8:35 AM, Volko Straub <[hidden email]> wrote:

> Hi Danielle,
>
> Further to Avital suggestion, you could also add all the regions selected
> by the last line of your code to the ROI manager and then use a For-loop to
> run through all the regions to carry out individual measurements on each
> ROI.
> Something like:
> run("Analyze Particles...", "size=0-Infinity show=Outlines summarize add");
> for(i=1;i<roiManager("count")+1;i++){
>     roiManager("Select",i);
>     run("Measure");
> }
>
> Hope this helps,
> Volko
>
>
> On 09/09/2015 06:01, Avital Steinberg wrote:
>
>> Hi Danielle,
>> If I understand you correctly, you have large red objects which may
>> contain more than one green objects within them. If this is the case, after
>> you segment the red objects, you can use them as an overlay on the green
>> channel.
>>
>> Then, you can iterate over the red objects, use adjust, threshold for
>> each ROI separately, and then you'll be able to keep track: which green
>> objects are within which red object.
>>
>> I hope I understood your problem correctly.
>>
>> Good luck,
>> Avital
>>
>> Sent from my iPhone
>>
>> On Sep 9, 2015, at 6:35 AM, Danielle Harmon <[hidden email]> wrote:
>>>
>>> Dear List,
>>>
>>> I have images with two channels (red and green).  I'd like to first
>>> segment the red objects and then calculate the amount (area) of green
>>> signal per red object, on an object by object basis.
>>>
>>> I can easily calculate the area of green contained within the red with
>>> the script below, but I can't figure out how to get the area of green per
>>> red object.  Is it possible?  Any and all advice is very welcome!!
>>>
>>> Thanks tons!
>>>
>>> Danielle
>>>
>>> p.s. I hope to automate/batch this analysis.
>>>
>>> imgName=getTitle();
>>> run("Split Channels");
>>> selectWindow(imgName + " (blue)");
>>> close();
>>> selectWindow(imgName + " (red)");
>>> setAutoThreshold("Default");
>>> //run("Threshold...");
>>> setThreshold(40, 255);
>>> setOption("BlackBackground", false);
>>> run("Convert to Mask");
>>> run("Analyze Particles...", "size=50-Infinity show=Outlines summarize");
>>> selectWindow(imgName + " (red)");
>>> selectWindow("Drawing of " + imgName + " (red)");
>>> close();
>>> selectWindow(imgName + " (red)");
>>> //run("Threshold...");
>>> setThreshold(0, 243);
>>> run("Convert to Mask");
>>> imageCalculator("Subtract create", imgName + " (green)", imgName + "
>>> (red)");
>>> selectWindow("Result of " + imgName + " (green)");
>>> setAutoThreshold("Default");
>>> //run("Threshold...");
>>> setThreshold(75, 255);
>>> run("Convert to Mask");
>>> run("Analyze Particles...", "size=0-Infinity show=Outlines summarize");
>>>
>>>
>>>
>>> This message is intended only for the confidential use of the intended
>>> recipient(s). If you have received this communication in error, please
>>> notify the sender by reply e-mail, and delete the original message and any
>>> attachments. Any unauthorized disclosure, copying, or distribution of this
>>> message (including the attachments), or the taking of any action based on
>>> it, is strictly prohibited.
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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