Problem with Find Maxima in Macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with Find Maxima in Macro

Adrián Villalba
Dear all,

I developed a macro (BetaCell_count) to count cell nucleus within a
specific stain (example_image). The macro performed a selection of the
population stain (green for insulin):

title = getTitle();
run("Split Channels");

selectWindow(title+" (green)");
// process the green channel;
setAutoThreshold("Moments dark");
//run("Threshold...");
//setThreshold(69, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Close-");
run("Fill Holes");
run("Dilate");
run("Remove Outliers...", "radius=50 threshold=50 which=Bright");
run("Create Selection");

Then i try to do find maxima within this ROI (the processed blue channel
for DAPI):

selectWindow(title+" (blue)");
// process the blue channel;
run("Restore Selection");
run("Find Maxima...", "noise=13 output=Count");

The problem i found is that find maxima counts very well for the number of
nucleus if compared to the manual count but it fails to locate them
properly (as you can see in the Output_BetaCounter) because most of the
points do not correlate with DAPI spots within the green ROI.

Do you know if i can correct the automatic assigned dots with the Find
Maxima or another process? Thank you in advance!



--

   - Adrián Villalba Felipe.
   https://es.linkedin.com/in/adrianvillalba

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

BetaCell_Count.txt (832 bytes) Download Attachment
Output_BetaCounter.tif (902K) Download Attachment
Ej7.jpg (162K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Find Maxima in Macro

Krs5
Dear Adrián,

You can filter your blue channel as well, like you did with the green channel.

For example adding:

run("Unsharp Mask...", "radius=5 mask=0.90");
run("Remove Outliers...", "radius=3 threshold=2 which=Bright");
run("Find Maxima...", "noise=50 output=Count");

Seems to give a decent result

I get a slightly better result with the image you attached using

run("Unsharp Mask...", "radius=5 mask=0.90");
run("Remove Outliers...", "radius=3 threshold=2 which=Bright");
run("Find Maxima...", "noise=50 output=[Maxima Within Tolerance]");
run("Close-");
run("Fill Holes");
run("Watershed");
run("Find Maxima...", "noise=1 output=[Point Selection] light");

Best wishes

Kees

Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
www.le.ac.uk/advanced-imaging-facility

ImageJ workshops 14 and 15 December: https://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/AIF/workshops/imagej-workshops-December-2017



-----Original Message-----
From: Adrián Villalba [mailto:[hidden email]]
Sent: 23 October 2017 09:19
To: [hidden email]
Subject: Problem with Find Maxima in Macro

Dear all,

I developed a macro (BetaCell_count) to count cell nucleus within a specific stain (example_image). The macro performed a selection of the population stain (green for insulin):

title = getTitle();
run("Split Channels");

selectWindow(title+" (green)");
// process the green channel;
setAutoThreshold("Moments dark");
//run("Threshold...");
//setThreshold(69, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Close-");
run("Fill Holes");
run("Dilate");
run("Remove Outliers...", "radius=50 threshold=50 which=Bright"); run("Create Selection");

Then i try to do find maxima within this ROI (the processed blue channel for DAPI):

selectWindow(title+" (blue)");
// process the blue channel;
run("Restore Selection");
run("Find Maxima...", "noise=13 output=Count");

The problem i found is that find maxima counts very well for the number of nucleus if compared to the manual count but it fails to locate them properly (as you can see in the Output_BetaCounter) because most of the points do not correlate with DAPI spots within the green ROI.

Do you know if i can correct the automatic assigned dots with the Find Maxima or another process? Thank you in advance!



--

   - Adrián Villalba Felipe.
   https://es.linkedin.com/in/adrianvillalba

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

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