Posted by
Jeremy Adler-2 on
Feb 09, 2018; 10:21am
URL: http://imagej.273.s1.nabble.com/Voronoi-plugin-not-adjusted-tp5020029p5020044.html
You want the area of individual cells within an area selected from the green image.
Your problem is to that the areas created by the Voronoi extend to the edge of the image.
So - use the selection from the green channel to remove the extended Voronoi
Save the selection in the ROI manager edit selection/add to manager
The after creating the Voronoi get the Selection back from the ROI Manager and clear the area outside the Selection Leaving the areas created by the Voronoi within the Green area - the area nearest each nucleus.
A demo that returns the area nearest to each dot within a ROI
// close results window - if open
if (isOpen("Results")) {
selectWindow("Results");
run("Close");
} ;
newImage("Untitled", "8-bit random", 200, 200, 1);
setAutoThreshold("Default dark");
setThreshold(208, 255);
setOption("BlackBackground", true);
run("Convert to Mask");// make a binary image with a few dots
run("Specify...", "width=90 height=90 x=77 y=77 oval centered");// make a ROI - you get this from your Green channel
run("Clear Outside");// remove dots outside ROI
run("Voronoi");
run("Make Inverse");// invert the ROI
setForegroundColor(255, 255, 255);// colour for the FILL
run("Fill", "slice");
run("Select None");// turn off ROI
setThreshold(0, 0);// voronoi area selected roiManager("reset");
run("Set Measurements...", "area centroid limit redirect=None decimal=2");// what measured
run("Analyze Particles...", "display exclude add");
run("Grays");
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Adrián Villalba
Sent: den 8 februari 2018 23:40
To:
[hidden email]
Subject: Re: Voronoi plugin not adjusted
Dear Kenneth,
Thank you for your hint. I achieve to perform now the Voronoi to the whole image (as i understand you suggested). Do you know at this point how can i restrict it to to my green positive are and even measure the area of each ROI of interest?
Thank you
Macro:
run("Duplicate...", " ");
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");
selectWindow(title+" (blue)");
// process the blue channel;
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("Delaunay Voronoi", "mode=Voronoi interactive"); run("Close-"); run("Fill Holes"); run("Watershed"); run("Find Maxima...", "noise=1 output=[Point Selection] light"); run("Delaunay Voronoi", "mode=Voronoi interactive");
2018-02-08 22:38 GMT+01:00 Kenneth Sloan <
[hidden email]>:
> I usually do this sort of restriction by limiting the analysis to
> Voronoi regions which are completely in the ROI (your "green region").
> But, I also always roll my own Voronoi computations, and have no clue
> how to do that using the standard tool, and especially not in the macro language.
>
> Even so, I thought this hint might be useful.
>
> You WANT the Voronoi computation to include the entire image, because
> those half-infinite regions provide boundaries for the ones you want
> to analyze. Use as much area as possible to create the Voronoi
> Diagram, and then clip out and reject any Voronoi region that is not
> entirely contained inside your ROI. In practice, this means computing
> the Voronoi vertices and checking that each one is inside the ROI,
>
> --
> Kenneth Sloan
>
[hidden email]
> Vision is the art of seeing what is invisible to others.
>
>
>
>
>
> > On 8 Feb 2018, at 10:08 , Adrián Villalba <
[hidden email]> wrote:
> >
> > Dear all,
> >
> > Thank you all for your help. I am trying to perform Voronoi - using
> > the DelaunayVoronoi plugin in Plugin>Analyze) to calculte
> > (aproximately) the area of positive staining in each cell.
> >
> > I used a homemade macro:
> >
> > run("Duplicate...", " ");
> > 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");
> >
> >
> > selectWindow(title+" (blue)");
> > // process the blue channel;
> > run("Restore Selection");
> > 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("Delaunay Voronoi", "mode=Voronoi interactive"); run("Close-");
> > run("Fill Holes"); run("Watershed"); run("Find Maxima...", "noise=1
> > output=[Point Selection] light"); run("Delaunay Voronoi",
> > "mode=Voronoi interactive");
> >
> >
> > The point is that the surrounding nuclei of my section has a Voronoi
> > area to the boundaries of the image and i only want to perform that
> > in the green-positive selection. I can not restore in the same image
> > the find maxima output to locate the nuclei and the selection i
> > previously used in my green channel. Does anyone know how can i
> > apply Voronoi with my selection boundaries instead of performing Voroni to the whole picture?
> And
> > if it is possible, how can i measure the area of each Voronoi-region?
> >
> > Thank you in advance!
> >
> >
> > --
> >
> > - Adrián Villalba Felipe.
> >
https://es.linkedin.com/in/adrianvillalba> >
> > --
> > ImageJ mailing list:
http://imagej.nih.gov/ij/list.html> > <input_Voronoi.tif><Voronoi output.tif>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
- 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