![]() | ![]() |
![]() |
Previous Message |
Next Message Previous in Topic | Next in Topic Previous by Same Author | Next by Same Author Previous Page (December 2007) | Back to Main IMAGEJ Page | | ![]()
Reply
| Post a New Message |
Join or Leave IMAGEJ, or Change Options
|
Search | ![]()
Chronologically |
Most Recent First |
Wrap Text (Proportional Font) |
Don't Wrap Text (Non-proportional Font) | ![]() |
Approved-By: [log in to unmask] References: <002f01c8353c$fe9f45e0$6502a8c0@lucena> <[log in to unmask]> User-Agent: SquirrelMail/1.4.3a Content-Type: text/plain;charset=iso-8859-2 Importance: Normal Message-ID: <[log in to unmask]> Date: Mon, 3 Dec 2007 11:36:08 +0100 Reply-To: ImageJ Interest Group <[log in to unmask]> Sender: ImageJ Interest Group <[log in to unmask]> From: Jarosław Grodek <[log in to unmask]> Subject: Re: macro question - macro text In-Reply-To: <[log in to unmask]>once again i feel sorry, my firts message contained image for analysis, in tiff format and NIH server rejected it. i cite it : <<Dear IJ Users! I would like to ask you for help with macro designing. what i intend to do is to create macro wich will show number of objects with internal damage and will print which object(grain) is damaged(infested) in which extent. below is presented what i created and artificial image is attached to this e-mail. hope there is someone who may help me to go one step forward?>> if anyone could help contact me on [log in to unmask] and i will reply with image for analysis. thanks in advance Jarek Grodek On Pn Grudnia 3 2007, 9:50, Jarosław Grodek napisał(a): > I apologise for my mistake, here is the text of the macro: > > run("Set Scale...", "distance=21.4 known=1 pixel=1 unit=mm global"); > run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 > show=Masks exclude include add"); > rename("mask"); > run("Erode"); > run("Erode"); > run("Erode"); > run("Erode"); > run("Erode"); > run("Invert LUT"); > run("Invert"); > imageCalculator("Add", "ori.tif","mask"); > //run("Image Calculator...", "image1=ori.tif operation=Add image2=mask"); > selectWindow("mask"); > close; > selectWindow("ori.tif"); > run("Select None"); > > > roiManager("Select", 0);print("1");run("Clear Results"); > run("Set Measurements...", "area redirect=None decimal=3"); > run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 > show=Nothing display exclude"); > getStatistics(area); > if (nResults==0) { > print("sound kernel"); > } else { > print("infested"); > } > if (area>=0.050 && area<=0.051) > print("egg"); > else if (area>=0.052 && area<=1.50) > print("1st instar"); > else if (area>=1.51 && area<=3.50) > print("2nd instar"); > else if (area>=3.51 && area<=5.50) > print("3rd instar"); > else if (area>=5.51 && area<=10.50) > print("4th instar"); > else if (area>=10.51 && area<=10.55) > print("prepupa"); > else if (area>=10.56 && area<=10.59) > print("pupa"); > > > roiManager("Select", 1);print("2");run("Clear Results"); > run("Set Measurements...", "area redirect=None decimal=3"); > run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 > show=Nothing display exclude"); > getStatistics(area); > if (nResults==0) { > print("sound kernel"); > } else { > print("infested"); > } > i=nResults; > for (i=0; i<nResults; i++) { > getResult("Area",i) > if (i++>=0.050 && i++<=0.051) > print("egg"); > else if (i++>=0.052 && i++<=1.50) > print("1st instar"); > else if (i++>=1.51 && i++<=3.50) > print("2nd instar"); > else if (i++>=3.51 && i++<=5.50) > print("3rd instar"); > else if (i++>=5.51 && i++<=10.50) > print("4th instar"); > else if (i++>=10.51 && i++<=10.55) > print("prepupa"); > else if (i++>=10.56 && i++<=10.59) > print("pupa"); > > } > > > > roiManager("Select", 2);print("3");run("Clear Results"); > run("Set Measurements...", "area redirect=None decimal=3"); > run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 > show=Nothing display exclude"); > getStatistics(area); > if (nResults==0) { > print("sound kernel"); > } else { > print("infested"); > } > if (area>=0.050 && area<=0.051) > print("egg"); > else if (area>=0.052 && area<=1.50) > print("1st instar"); > else if (area>=1.51 && area<=3.50) > print("2nd instar"); > else if (area>=3.51 && area<=5.50) > print("3rd instar"); > else if (area>=5.51 && area<=10.50) > print("4th instar"); > else if (area>=10.51 && area<=10.55) > print("prepupa"); > else if (area>=10.56 && area<=10.59) > print("pupa"); > > roiManager("Select", 3);print("4");run("Clear Results"); > run("Set Measurements...", "area redirect=None decimal=3"); > run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 > show=Nothing display exclude"); > getStatistics(area); > if (nResults==0) { > print("sound kernel"); > } else { > print("infested"); > } > if (area>=0.050 && area<=0.051) > print("egg"); > else if (area>=0.052 && area<=1.50) > print("1st instar"); > else if (area>=1.51 && area<=3.50) > print("2nd instar"); > else if (area>=3.51 && area<=5.50) > print("3rd instar"); > else if (area>=5.51 && area<=10.50) > print("4th instar"); > else if (area>=10.51 && area<=10.55) > print("prepupa"); > else if (area>=10.56 && area<=10.59) > print("pupa"); > > roiManager("Select", 4);print("5");run("Clear Results"); > run("Set Measurements...", "area redirect=None decimal=3"); > run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 > show=Nothing display exclude"); > getStatistics(area); > if (nResults==0) { > print("sound kernel"); > } else { > print("infested"); > } > getStatistics(area); > if (area>=0.050 && area<=0.051) > print("egg"); > else if (area>=0.052 && area<=1.50) > print("1st instar"); > else if (area>=1.51 && area<=3.50) > print("2nd instar"); > else if (area>=3.51 && area<=5.50) > print("3rd instar"); > else if (area>=5.51 && area<=10.50) > print("4th instar"); > else if (area>=10.51 && area<=10.55) > print("prepupa"); > else if (area>=10.56 && area<=10.59) > print("pupa"); > > run("Select None"); > > > > thanks i advance for help > Jarek Grodek > > MSc Eng. Jaroslaw Grodek Institute of Agrophysics Polish Academy of Sciences in Lublin Doswiadczalna 4 20-290 Lublin Poland
![]() |
![]() Center for Information Technology National Institutes of Health Bethesda, Maryland 20892 301 594 6248 (v) 301 496 8294 (TDD) Comments and Assistance Accessibility ![]() |