Voronoi plugin not adjusted

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

Voronoi plugin not adjusted

Adrián Villalba
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 (2M) Download Attachment
Voronoi output.tif (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Voronoi plugin not adjusted

Kenneth Sloan-2
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
Reply | Threaded
Open this post in threaded view
|

PHANTAST export results problem

ALEMBIC | Cesare
Dear List,
I'm using Phantast plugin for Fiji to analyze brightfield phase contrast time lapses and it works great (!).
Moreover, I have problems in exporting confluency data: the tabulated .xls file generated is completely misunaligned importing in excel.
I tried to change format, tabulation,etc. but without achievment.
Anyone experienced this problem and/or known if  there's another way to import Results file in excel with the correct fields alignement?

Thanks in advance for any comments or suggestion

All the best,

Cesare
--

_________________________________________________________________________________
Dr. Cesare Covino, M.Sc.
Facility Manager
ALEMBIC
Advanced Light and Electron Microscopy BioImaging Center
San Raffaele Scientific Institute
DIBIT 1  S2B4a
via Olgettina 58, 20132 - Milano - Italy
Tel +39-022643-4636(others -4640, -4641)
Fax +39-022643-4646
e-mail: [hidden email]<mailto:[hidden email]>
ALEMBIC webpage: http://research.hsr.it/alembic.html


Rispetta l’ambiente: non stampare questa mail se non è necessario.
Respect the environment: if it's not necessary, don't print this mail.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Voronoi plugin not adjusted

Adrián Villalba
In reply to this post by Kenneth Sloan-2
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

s3-1.jpg (blue) Maxima.tif (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Voronoi plugin not adjusted

Kenneth Sloan-2
Sorry - no.  As I said earlier, I do my own Voronoi computations (in Java) and generally export both the entire Voronoi Diagram and a polygon outlining the ROI to a .csv file for further processing by non-ImageJ Java programs.

I have no experience in using the plugins to process Voronoi Diagrams (and also very little experience with
the ImageJ macro language).


--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On 8 Feb 2018, at 16:39 , Adrián Villalba <[hidden email]> wrote:
>
> 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
> <s3-1.jpg (blue) Maxima.tif>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Voronoi plugin not adjusted

Gabriel Landini
To avoid using ROIs, you could also use one morphological equivalent of the
voronoi diagram using the Find Maxima command, e.g.:

run("Blobs (25K)");
run("Grays"); // so you see the normal LUT
run("Gaussian Blur...", "sigma=5"); //remove some spurious maxima
run("Find Maxima...", "noise=15 output=[Segmented Particles]");

Then in a copy of the original, threshold your cells in green+red channel (to
get the cell cluster) and compute the logical AND operation between the
thresholded cluster with the result of the Find Maxima. That should retain the
segmented cells that are in the cluster from the green+red channels.

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

strange OSX text input behaviour?

Frederic V. Hessman
One of our teachers reports that he has problems with keyboard input in sub-windows (e.g. changing the parameters of an Image Sequence input) -- and ONLY in sub-windows! -- using ImageJ 1.5.1s AND AstroImage 3.2.0 under OSX 10.13.3.

Has anyone else seen this behaviour?

Rick

> Das Problem taucht nicht nur bei AstroImageJ sondern auch bei ImageJ auf (Version 1.5.1s), dort scheint der eigentliche Fehler zu liegen.
> Ich wähle Import > Image Sequence > wähle ein Verzeichnis und bekomme ein Popup „Sequence Options“ und kann dort weder an den Zahlen etwas ändern, noch bei File name contains etwas eingeben. Anklicken und auswählen funktioniert.

>>> Installed I have AstroImageJ Version 3.2.0 with Java 1.6.0_65 and my IOS is High Sierra 10.13.3.
>>>
>>> The problem rises, when AstroImageJ opens a sub-window, where I can input text or numbers, it does not accept any keys from my keyboard. I help myself with a textedit-window aside and with copy-and-paste, but that is not very fine.
>>>
>>> Do you have the same problem and is there anything I can do to fix it?

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: strange OSX text input behaviour?

Michael Schmid
Hi everyone,

we have had the same problem (input by typing into dialog fields was
impossible). It disappeared after downloading ImageJ for OS X with Java
1.8 from the web site and following the instructions there:

   https://imagej.nih.gov/ij/docs/install/osx.html

After downloading, use Help>Update ImageJ to get the latest version.


Michael
________________________________________________________________
On 09/02/2018 10:01, Frederic V. Hessman wrote:

> One of our teachers reports that he has problems with keyboard input in sub-windows (e.g. changing the parameters of an Image Sequence input) -- and ONLY in sub-windows! -- using ImageJ 1.5.1s AND AstroImage 3.2.0 under OSX 10.13.3.
>
> Has anyone else seen this behaviour?
>
> Rick
>
>> Das Problem taucht nicht nur bei AstroImageJ sondern auch bei ImageJ auf (Version 1.5.1s), dort scheint der eigentliche Fehler zu liegen.
>> Ich wähle Import > Image Sequence > wähle ein Verzeichnis und bekomme ein Popup „Sequence Options“ und kann dort weder an den Zahlen etwas ändern, noch bei File name contains etwas eingeben. Anklicken und auswählen funktioniert.
>
>>>> Installed I have AstroImageJ Version 3.2.0 with Java 1.6.0_65 and my IOS is High Sierra 10.13.3.
>>>>
>>>> The problem rises, when AstroImageJ opens a sub-window, where I can input text or numbers, it does not accept any keys from my keyboard. I help myself with a textedit-window aside and with copy-and-paste, but that is not very fine.
>>>>
>>>> Do you have the same problem and is there anything I can do to fix it?
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Voronoi plugin not adjusted

Jeremy Adler-2
In reply to this post by Adrián Villalba
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
Reply | Threaded
Open this post in threaded view
|

Re: Voronoi plugin not adjusted

Kenneth Sloan-2
I think this is almost right - and may be what you want, BUT... My preference would be to eliminate Voronoi Cells that are *completely* inside the "green area".  I'm not sure this does this.

The question is: do you want Voronoi cells that are:

a) COMPLETLY INSIDE the green area
b) NOT COMPLETELY OUTSIDE
c) parts of cells that are NOT COMPLETELY OUTSIDE
d) parts of cells that are NOT COMPLETELY OUTSIDE whose "site" is INSIDE

If the surrounding region is sufficiently large, and the cells are sufficiently small, then I suspect that either a) or b) might be acceptable.  I don't think c) is ever correct; d) *may* be acceptable, depending on the problem.  

In my work, I usually use a).  The problem with that is that you must compute and filter based on ALL the vertices of each Voronoi Cell.  Inclusion/exclusion should be on the Voronoi Cell level; I don't think you can do this on the pixel level.  It *may* be that you can include/exclude based on the sites

But, again - I don't use the ImageJ Voronoi functions, so I may be off base here.  I do know that this kind of border problem can be hard to handle correctly, and can significantly skew your results.

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On 9 Feb 2018, at 04:21 , Jeremy Adler <[hidden email]> wrote:
>
> 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] <mailto:[hidden email]>] On Behalf Of Adrián Villalba
> Sent: den 8 februari 2018 23:40
> To: [hidden email] <mailto:[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 <http://imagej.nih.gov/ij/list.html>

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