Login  Register

Re: object-oriented segmentation

Posted by Krs5 on Dec 12, 2012; 12:39pm
URL: http://imagej.273.s1.nabble.com/object-oriented-segmentation-tp5001110p5001133.html

Hi Michiel,


The macro code below is doing  what you have in mind  for the images you sent. You might have play around with some of the settings to have it working for other images. Both images have to be opened when you run the code.

There seems to be a problem when I use run("Flatten") in the macro. I get a black/red image (with white ROI lines) instead of a black/white image. If I run it manually it works fine. Did an extra thresholding to solve this problem.


selectWindow("Nuclei_Raw.jpg");
setAutoThreshold("Huang dark");
//run("Threshold...");
setAutoThreshold("Huang dark");
setAutoThreshold("Default dark");
setThreshold(34, 255);
run("Convert to Mask");
run("Watershed");
run("Voronoi");
setThreshold(0, 0);
run("Convert to Mask");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Nothing add");
roiManager("Show All with labels");
roiManager("Show All");
selectWindow("Cytoplasm_Raw.jpg");
run("Duplicate...", "title=Cytoplasm_Raw-o.jpg");
selectWindow("Cytoplasm_Raw.jpg");
//run("Threshold...");
setAutoThreshold("Default dark");
setThreshold(35, 255);
run("Convert to Mask");
roiManager("Show All without labels");
roiManager("Set Color", "white");
roiManager("Set Line Width", 0);
run("Flatten"); //at this point should be B/W but selection is in red with white ROIs
run("8-bit");
// seems to be a problem with flatten when run in the macro.
// Need additonal thresholding
setThreshold(71, 100);
run("Convert to Mask");
roiManager("Delete");wait(1000);
selectWindow("Cytoplasm_Raw-1.jpg");
run("Analyze Particles...", "size=250-Infinity circularity=0.00-1.00 show=Nothing add");
selectWindow("Cytoplasm_Raw-o.jpg");
roiManager("Show All");

Groetjes

Kees


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Michiel van Dommelen
Sent: 12 December 2012 10:50
To: [hidden email]
Subject: Re: object-oriented segmentation

Hey Kees,

Your new method sounds interesting. Below you can find the images without ROIs.
The original images are 12bit TIF files. I had to transform them into 8bit JPEG to upload them here.

I am looking forward to see if this works..

Many thanks,
Michiel

<http://imagej.1557.n6.nabble.com/file/n5001130/Cytoplasm_Raw.jpg>
<http://imagej.1557.n6.nabble.com/file/n5001130/Nuclei_Raw.jpg>



--
View this message in context: http://imagej.1557.n6.nabble.com/object-oriented-segmentation-tp5001110p5001130.html
Sent from the ImageJ mailing list archive at Nabble.com.

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

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