I have established a macro to isolate and characterize some fat crystals. The macro is as follows:
_________________________ open("C:\\Users\\Karina\\Desktop\\Pics for Karina\\10HCO 90CO 2000s-1 0-5mm gap 70C to 20C diluted 10X 2 no polarization 2.tif"); run("Set Scale...", "distance=96 known=100 pixel=1 unit=um global"); rename("original"); run("8-bit"); run("Duplicate...", "title=main"); run("Find Edges"); run("Enhance Contrast...", "saturated=0 equalize"); setThreshold(84, 255); run("Convert to Mask"); //Noise Removal run("Median...", "radius=3"); //Filter out other noises run("Analyze Particles...", "size=85-Infinity pixel circularity=0.0-1.00 show=Masks"); run("Watershed"); run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 show=Masks display clear"); rename("particles"); selectWindow("Mask of main"); close(); selectWindow("particles"); run("Duplicate...", "title=particles-1"); run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 show=Ellipses display exclude clear"); selectWindow("Drawing of particles-1"); run("Fill Holes"); run("Watershed"); selectWindow("Drawing of particles-1"); run("Duplicate...", "title=[Drawing of particles-2]"); //comparison run("Merge Channels...", "c1=[Drawing of particles-1] c2=[original]"); selectWindow("Drawing of particles-2"); run("Make Binary"); run("Set Measurements...", " fit redirect=None decimal=3"); run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 show=Nothing display clear"); _______________________ After running the macro you get the image which is attached. How could I isolate these particles (ellipses) from this image? In other words, I would like to isolate each particle and save them separately. ps: I just want to extract every single particle (ellipse) on its own. I don't want to maintain the particle in the same white image. I want to extract to a new one in order to save every particle in different images. Thank you, Karina. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Karina,
> I just want to extract every single particle (ellipse) on its own. I > don't want to maintain the particle in the same white image. I want to > extract to a new one in order to save every particle in different > images. Did you try "Watershed" (to cut connected blobs) followed by "Analyze Particles"? (Press L to bring up the Command Finder to execute these commands easily.) For "Analyze Particles" be sure "Add to ROI Manager" is checked, and you will get each particle as its own ROI in there. After that the sky is the limit -- e.g., you can write a macro to loop over the ROIs and do whatever you want with them. You can also go back to your original image (before you made it into a binary mask) and then use the same ROIs from the manager to perform measurements using the More > Multi Measure command. Regards, Curtis On Tue, Jul 16, 2013 at 9:33 AM, Karina Ferreira <[hidden email]>wrote: > I have established a macro to isolate and characterize some fat crystals. > The macro is as follows: > > _________________________ > open("C:\\Users\\Karina\\Desktop\\Pics for Karina\\10HCO 90CO 2000s-1 > 0-5mm gap 70C to 20C diluted 10X 2 no polarization 2.tif"); > run("Set Scale...", "distance=96 known=100 pixel=1 unit=um global"); > rename("original"); > run("8-bit"); > run("Duplicate...", "title=main"); > run("Find Edges"); > run("Enhance Contrast...", "saturated=0 equalize"); > setThreshold(84, 255); > run("Convert to Mask"); > //Noise Removal > run("Median...", "radius=3"); > //Filter out other noises > run("Analyze Particles...", "size=85-Infinity pixel circularity=0.0-1.00 > show=Masks"); > run("Watershed"); > run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 > show=Masks display clear"); > rename("particles"); > selectWindow("Mask of main"); > close(); > selectWindow("particles"); > run("Duplicate...", "title=particles-1"); > run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 > show=Ellipses display exclude clear"); > selectWindow("Drawing of particles-1"); > run("Fill Holes"); > run("Watershed"); > selectWindow("Drawing of particles-1"); > run("Duplicate...", "title=[Drawing of particles-2]"); > //comparison > run("Merge Channels...", "c1=[Drawing of particles-1] c2=[original]"); > selectWindow("Drawing of particles-2"); > run("Make Binary"); > run("Set Measurements...", " fit redirect=None decimal=3"); > run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 > show=Nothing display clear"); > _______________________ > > After running the macro you get the image which is attached. > > How could I isolate these particles (ellipses) from this image? In other > words, I would like to isolate each particle and save them separately. > > ps: I just want to extract every single particle (ellipse) on its own. I > don't want to maintain the particle in the same white image. I want to > extract to a new one in order to save every particle in different images. > > Thank you, > > Karina. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by KarinaFerreira
Dear Karina,
When you select Analyze Particles select also the option "Add to Manager". This will add every selected particle to the ROI manager. Now you can make a loop and select each item in the ROI Manager list and for example duplicate it (Image > Duplicate) and the selected particle will appear in its own image. Best wishes Kees Dr Ir K.R. Straatman Senior Experimental Officer Centre for Core Biotechnology Services University of Leicester http://www.le.ac.uk/biochem/microscopy/home.html -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Karina Ferreira Sent: 16 July 2013 15:33 To: [hidden email] Subject: How to isolate particles using imagej? I have established a macro to isolate and characterize some fat crystals. The macro is as follows: _________________________ open("C:\\Users\\Karina\\Desktop\\Pics for Karina\\10HCO 90CO 2000s-1 0-5mm gap 70C to 20C diluted 10X 2 no polarization 2.tif"); run("Set Scale...", "distance=96 known=100 pixel=1 unit=um global"); rename("original"); run("8-bit"); run("Duplicate...", "title=main"); run("Find Edges"); run("Enhance Contrast...", "saturated=0 equalize"); setThreshold(84, 255); run("Convert to Mask"); //Noise Removal run("Median...", "radius=3"); //Filter out other noises run("Analyze Particles...", "size=85-Infinity pixel circularity=0.0-1.00 show=Masks"); run("Watershed"); run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 show=Masks display clear"); rename("particles"); selectWindow("Mask of main"); close(); selectWindow("particles"); run("Duplicate...", "title=particles-1"); run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 show=Ellipses display exclude clear"); selectWindow("Drawing of particles-1"); run("Fill Holes"); run("Watershed"); selectWindow("Drawing of particles-1"); run("Duplicate...", "title=[Drawing of particles-2]"); //comparison run("Merge Channels...", "c1=[Drawing of particles-1] c2=[original]"); selectWindow("Drawing of particles-2"); run("Make Binary"); run("Set Measurements...", " fit redirect=None decimal=3"); run("Analyze Particles...", "size=85-Infinity pixel circularity=0.35-1.00 show=Nothing display clear"); _______________________ After running the macro you get the image which is attached. How could I isolate these particles (ellipses) from this image? In other words, I would like to isolate each particle and save them separately. ps: I just want to extract every single particle (ellipse) on its own. I don't want to maintain the particle in the same white image. I want to extract to a new one in order to save every particle in different images. Thank you, Karina. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |