Posted by
jchanson on
Jan 17, 2008; 9:54pm
URL: http://imagej.273.s1.nabble.com/Logical-operation-on-ROIs-tp3697543p3697546.html
Zhengyu -
You could use the Edit>Select>Create Mask and Edit>Invert
commands... To combine your ROI's and then find the inverted area. I've
recorded a macro of that in my "ps" to this message.
If you've got complicated operations that you'd like to do with
images that you've thresholded, use the Process>Image Calculator... This
way, you can just keep track of thresholded images, rather than ROIs. Once
you've added and subtracted all of the different thresholded images, you
can use Analyze>Set Measurements... to set the "redirect" to point to your
original image and then use Analyze>Analyze Particles... to generate your
data.
Good luck,
Jeff Hanson
Senior Imaging Analyst
[hidden email]
ps - Here is macro code that would find the difference using 2 ROI's:
// <<add code here for finding first ROI>>
// Add the first ROI to the ROI manager
roiManager("Add");
// <<add code here for finding second ROI>>
roiManager("Add");
// Make the mask
roiManager("Select", 0);
run("Create Mask");
run("Select None");
roiManager("Select", 1);
run("Create Mask");
run("Select None");
run("Invert");
// Turn this "found" area in to an ROI
run("Create Selection");
"Pang, Zhengyu (GE, Research)" <
[hidden email]>
Sent by: ImageJ Interest Group <
[hidden email]>
01/17/2008 01:08 PM
Please respond to
ImageJ Interest Group <
[hidden email]>
To
[hidden email]
cc
Subject
Re: Logical operation on ROIs
Jerome,
Thanks for your reply. I found that your method is good if I manaully
trace the ROI1 and ROI2.
In my case, I specified my ROI based on its grayscale value (pixel value
> threshold) "Image>Adjust>Threshold" and then use the function
"Edit/Selection/Create Selection". I could not follow what you
instructed. Is there anyway to get around this?
Thanks,
Zhengyu
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
Jerome Mutterer
Sent: Thursday, January 17, 2008 2:25 AM
To:
[hidden email]
Subject: Re: Logical operation on ROIs
Zhengyu,
You can trace ROI1, then keep the shift key down and trace ROI2. Now
invert the selection using Edit/Selection/Make Inverse.
In a macro, use the setKeyDown('shift'); function.
Jerome
On Jan 17, 2008 4:00 AM, Pang, Zhengyu (GE, Research)
<
[hidden email]>
wrote:
> Could I perform logical operation on ROIs? For example, If I have
> specified ROI1 and ROI2, could I define ROI3=whole image-ROI1-ROI2?
> And then perform necessary measurement on ROI3.
>
> Do I need to install some plugins to do it?
>
> Thanks!
>
> Zhengyu
> > g Global Research Center
> >
> > ____________________________________________________________________
> > __
> >
> > Zhengyu Pang, Ph.D.
> Bioanalytics and Protein Science Laboratory
> Biosciences Global Technology Organization
> > One Research Circle, K1 5B37A
> > Niskayuna, NY12309
> > *
[hidden email]
> > *(518) 387-4015
> >
> >
>