Edge spots to center

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

Edge spots to center

Adrián Villalba
 Dear all,

I have a macro that locate the nuclei of each cell within an area (green,
insulin positive area). I would be very pleased to know if it is possible
to determine how long or which distance there is beween each nuclei and the
geometric center of that green area. It is something like to know the
distribution of each cell just to know if it is near to the center or
peripheral (near to the edge).

Thank you in advance,

This is my macro to locate nuclei and i attach some example image .


--

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

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

BetaCell_CountMod.txt (1K) Download Attachment
Ej7.tif (2M) Download Attachment
ard
Reply | Threaded
Open this post in threaded view
|

Re: Edge spots to center

ard
If you set measurements to measure the centre of mass in your Ej7.tif (green) image, you will find 6.452,6.706 as center of green area. Your image is calibrated as 18.66x14.22 inches, which is probably incorrect given the size of a nucleus visible.

From your Maxima image you can retrieve the coordinates of each nucleus. See this link for the macro code:
http://imagej.1557.x6.nabble.com/Getting-x-y-coordinates-of-the-multi-point-tool-td4490440.html

Given the coordinates of the centre of mass of the green area, Pythagoras will give you the distance of each nucleus centre with respect to the center of the insulin positive area, either in pixels or in real world units.

You can calculate the relative (percentage) position of the nucleus to the distance (centre-edge), using the Process>Binary>Distance Map of the green image and the distance to the centre of the insulin positive area.

Hope this helps.
Ard

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

Re: Edge spots to center

Volko Straub
In reply to this post by Adrián Villalba
Dear Adrian,
You can get the coordinates of the centre of mass for your Islet selection by including
run("Set Measurements...", "center redirect=None decimal=1");
run("Measure");  
in your code.
Using the Particle Analyzer after finding your nuclei can give you a list of the coordinates of all your nuclei; include
run("Analyze Particles...", "display");
after your findMaxima statement

You can then calculate the distance between each nucleus and the centre of between the individual nuclei.

The modified macro below prints a list of the nuclei coordinates and distances to centre of islet to the log window. The first line are the coordinates of the centre of mass for the islet.

Hope this helps,
Volko

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");
run("Set Measurements...", "center redirect=None decimal=1");
run("Measure");  //provides coordinates of centre of mass for islet
cX=getResult("XM",nResults-1);
cY=getResult("YM",nResults-1);
print(cX,cY);

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("Close-");
run("Fill Holes");
run("Watershed");
run("Find Maxima...", "noise=1 output=[Point Selection] light");
run("Analyze Particles...", "display"); //provides list of coordinates of centre of mass for each nucleus
for(i=1;i<nResults;i++){
d2c=sqrt(pow((getResult("XM",i)-cX),2)+pow((getResult("YM",i))-cY,2)); //distance to centre of islet
print(i,getResult("XM",i),getResult("YM",i),d2c);
}

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Adrián Villalba
Sent: 31 January 2018 23:02
To: [hidden email]
Subject: Edge spots to center

 Dear all,

I have a macro that locate the nuclei of each cell within an area (green, insulin positive area). I would be very pleased to know if it is possible to determine how long or which distance there is beween each nuclei and the geometric center of that green area. It is something like to know the distribution of each cell just to know if it is near to the center or peripheral (near to the edge).

Thank you in advance,

This is my macro to locate nuclei and i attach some example image .


--

   - 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: Edge spots to center

Adrián Villalba
Dear Dr. Straub,

Thank you very much for your help and the modified macro. I want to ask you
about the center mass of the islet in coordinates.
When i run:

run("Set Measurements...", "center redirect=None decimal=1");
run("Measure");  //provides coordinates of centre of mass for islet
cX=getResult("XM",nResults-1);
cY=getResult("YM",nResults-1);
print(cX,cY);

I get something like that:

357.3944 371.4366
1 262.5332 198.2361 197.4768

I guess that the two first numbers (in this case the first printed
line:  357.3944
371.4366) are those corresponding to the x,y coordinates of the center. But
i do not understand he second line. Finally, why do you getResult with
nResults-1?

The macro runs and works perfectly, and i checked it with more than one
picture and the results are the expected. Thank you very much for your
time, help and attention. My questions are -just to know or curiosity
questions - to understand better such great work.

Thank you very much again Dr Straub.


2018-02-01 9:47 GMT+01:00 Straub, Volko A. (Dr.) <[hidden email]>:

> Dear Adrian,
> You can get the coordinates of the centre of mass for your Islet selection
> by including
> run("Set Measurements...", "center redirect=None decimal=1");
> run("Measure");
> in your code.
> Using the Particle Analyzer after finding your nuclei can give you a list
> of the coordinates of all your nuclei; include
> run("Analyze Particles...", "display");
> after your findMaxima statement
>
> You can then calculate the distance between each nucleus and the centre of
> between the individual nuclei.
>
> The modified macro below prints a list of the nuclei coordinates and
> distances to centre of islet to the log window. The first line are the
> coordinates of the centre of mass for the islet.
>
> Hope this helps,
> Volko
>
> 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");
> run("Set Measurements...", "center redirect=None decimal=1");
> run("Measure");  //provides coordinates of centre of mass for islet
> cX=getResult("XM",nResults-1);
> cY=getResult("YM",nResults-1);
> print(cX,cY);
>
> 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("Close-");
> run("Fill Holes");
> run("Watershed");
> run("Find Maxima...", "noise=1 output=[Point Selection] light");
> run("Analyze Particles...", "display"); //provides list of coordinates of
> centre of mass for each nucleus
> for(i=1;i<nResults;i++){
> d2c=sqrt(pow((getResult("XM",i)-cX),2)+pow((getResult("YM",i))-cY,2));
> //distance to centre of islet
> print(i,getResult("XM",i),getResult("YM",i),d2c);
> }
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Adrián Villalba
> Sent: 31 January 2018 23:02
> To: [hidden email]
> Subject: Edge spots to center
>
>  Dear all,
>
> I have a macro that locate the nuclei of each cell within an area (green,
> insulin positive area). I would be very pleased to know if it is possible
> to determine how long or which distance there is beween each nuclei and the
> geometric center of that green area. It is something like to know the
> distribution of each cell just to know if it is near to the center or
> peripheral (near to the edge).
>
> Thank you in advance,
>
> This is my macro to locate nuclei and i attach some example image .
>
>
> --
>
>    - 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
>



--

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

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

Re: Edge spots to center

Volko Straub
Dear Adrian,

The first line in the log window (in your example: 357.3944 371.4366) contains the x and y coordinates of the centre of your islet.
The second line (1 262.5332 198.2361 197.4768) starts with a running number corresponding to the position of measurement in the result table, so 1, 2, 3, etc.
This is followed by the x and y coordinates of the centre of the first nucleus, here x=262.5332 and y=198.2361. The final value should be the distance of that nucleus to the centre of the islet.

The results in the result table are stored in an array. The index of the first element of an array is 0 not 1, and the index of the last element in an array is number of array elements - 1. So, the element nResults doesn't exist in the result table, but points a new line for the next measurement.

I hope this answers your questions. Let me know if there is anything else.

Regards,
Volko

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Adrián Villalba
Sent: 01 February 2018 16:04
To: [hidden email]
Subject: Re: Edge spots to center

Dear Dr. Straub,

Thank you very much for your help and the modified macro. I want to ask you about the center mass of the islet in coordinates.
When i run:

run("Set Measurements...", "center redirect=None decimal=1"); run("Measure");  //provides coordinates of centre of mass for islet cX=getResult("XM",nResults-1); cY=getResult("YM",nResults-1); print(cX,cY);

I get something like that:

357.3944 371.4366
1 262.5332 198.2361 197.4768

I guess that the two first numbers (in this case the first printed
line:  357.3944
371.4366) are those corresponding to the x,y coordinates of the center.

But i do not understand he second line. Finally, why do you getResult with nResults-1?

The macro runs and works perfectly, and i checked it with more than one picture and the results are the expected. Thank you very much for your time, help and attention. My questions are -just to know or curiosity questions - to understand better such great work.

Thank you very much again Dr Straub.


2018-02-01 9:47 GMT+01:00 Straub, Volko A. (Dr.) <[hidden email]>:

> Dear Adrian,
> You can get the coordinates of the centre of mass for your Islet
> selection by including run("Set Measurements...", "center
> redirect=None decimal=1"); run("Measure"); in your code.
> Using the Particle Analyzer after finding your nuclei can give you a
> list of the coordinates of all your nuclei; include run("Analyze
> Particles...", "display"); after your findMaxima statement
>
> You can then calculate the distance between each nucleus and the
> centre of between the individual nuclei.
>
> The modified macro below prints a list of the nuclei coordinates and
> distances to centre of islet to the log window. The first line are the
> coordinates of the centre of mass for the islet.
>
> Hope this helps,
> Volko
>
> 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"); run("Set Measurements...", "center
> redirect=None decimal=1"); run("Measure");  //provides coordinates of
> centre of mass for islet cX=getResult("XM",nResults-1);
> cY=getResult("YM",nResults-1); print(cX,cY);
>
> 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("Close-"); run("Fill Holes"); run("Watershed"); run("Find
> Maxima...", "noise=1 output=[Point Selection] light"); run("Analyze
> Particles...", "display"); //provides list of coordinates of centre of
> mass for each nucleus for(i=1;i<nResults;i++){
> d2c=sqrt(pow((getResult("XM",i)-cX),2)+pow((getResult("YM",i))-cY,2));
> //distance to centre of islet
> print(i,getResult("XM",i),getResult("YM",i),d2c);
> }
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Adrián Villalba
> Sent: 31 January 2018 23:02
> To: [hidden email]
> Subject: Edge spots to center
>
>  Dear all,
>
> I have a macro that locate the nuclei of each cell within an area
> (green, insulin positive area). I would be very pleased to know if it
> is possible to determine how long or which distance there is beween
> each nuclei and the geometric center of that green area. It is
> something like to know the distribution of each cell just to know if
> it is near to the center or peripheral (near to the edge).
>
> Thank you in advance,
>
> This is my macro to locate nuclei and i attach some example image .
>
>
> --
>
>    - 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
>



--

   - 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: Edge spots to center

Adrián Villalba
Dear Volko,

Thank you for your help. Regarding to your explanation, do you know if i
can have the distance (as i have in the second line, third value: 1
262.5332 198.2361 197.4768 ) for all the nuclei instead of only for the
first?

Thanks!

2018-02-01 17:30 GMT+01:00 Straub, Volko A. (Dr.) <[hidden email]>:

> Dear Adrian,
>
> The first line in the log window (in your example: 357.3944 371.4366)
> contains the x and y coordinates of the centre of your islet.
> The second line (1 262.5332 198.2361 197.4768) starts with a running
> number corresponding to the position of measurement in the result table, so
> 1, 2, 3, etc.
> This is followed by the x and y coordinates of the centre of the first
> nucleus, here x=262.5332 and y=198.2361. The final value should be the
> distance of that nucleus to the centre of the islet.
>
> The results in the result table are stored in an array. The index of the
> first element of an array is 0 not 1, and the index of the last element in
> an array is number of array elements - 1. So, the element nResults doesn't
> exist in the result table, but points a new line for the next measurement.
>
> I hope this answers your questions. Let me know if there is anything else.
>
> Regards,
> Volko
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Adrián Villalba
> Sent: 01 February 2018 16:04
> To: [hidden email]
> Subject: Re: Edge spots to center
>
> Dear Dr. Straub,
>
> Thank you very much for your help and the modified macro. I want to ask
> you about the center mass of the islet in coordinates.
> When i run:
>
> run("Set Measurements...", "center redirect=None decimal=1");
> run("Measure");  //provides coordinates of centre of mass for islet
> cX=getResult("XM",nResults-1); cY=getResult("YM",nResults-1); print(cX,cY);
>
> I get something like that:
>
> 357.3944 371.4366
> 1 262.5332 198.2361 197.4768
>
> I guess that the two first numbers (in this case the first printed
> line:  357.3944
> 371.4366) are those corresponding to the x,y coordinates of the center.
>
> But i do not understand he second line. Finally, why do you getResult with
> nResults-1?
>
> The macro runs and works perfectly, and i checked it with more than one
> picture and the results are the expected. Thank you very much for your
> time, help and attention. My questions are -just to know or curiosity
> questions - to understand better such great work.
>
> Thank you very much again Dr Straub.
>
>
> 2018-02-01 9:47 GMT+01:00 Straub, Volko A. (Dr.) <[hidden email]>:
>
> > Dear Adrian,
> > You can get the coordinates of the centre of mass for your Islet
> > selection by including run("Set Measurements...", "center
> > redirect=None decimal=1"); run("Measure"); in your code.
> > Using the Particle Analyzer after finding your nuclei can give you a
> > list of the coordinates of all your nuclei; include run("Analyze
> > Particles...", "display"); after your findMaxima statement
> >
> > You can then calculate the distance between each nucleus and the
> > centre of between the individual nuclei.
> >
> > The modified macro below prints a list of the nuclei coordinates and
> > distances to centre of islet to the log window. The first line are the
> > coordinates of the centre of mass for the islet.
> >
> > Hope this helps,
> > Volko
> >
> > 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"); run("Set Measurements...", "center
> > redirect=None decimal=1"); run("Measure");  //provides coordinates of
> > centre of mass for islet cX=getResult("XM",nResults-1);
> > cY=getResult("YM",nResults-1); print(cX,cY);
> >
> > 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("Close-"); run("Fill Holes"); run("Watershed"); run("Find
> > Maxima...", "noise=1 output=[Point Selection] light"); run("Analyze
> > Particles...", "display"); //provides list of coordinates of centre of
> > mass for each nucleus for(i=1;i<nResults;i++){
> > d2c=sqrt(pow((getResult("XM",i)-cX),2)+pow((getResult("YM",i))-cY,2));
> > //distance to centre of islet
> > print(i,getResult("XM",i),getResult("YM",i),d2c);
> > }
> >
> > -----Original Message-----
> > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> > Adrián Villalba
> > Sent: 31 January 2018 23:02
> > To: [hidden email]
> > Subject: Edge spots to center
> >
> >  Dear all,
> >
> > I have a macro that locate the nuclei of each cell within an area
> > (green, insulin positive area). I would be very pleased to know if it
> > is possible to determine how long or which distance there is beween
> > each nuclei and the geometric center of that green area. It is
> > something like to know the distribution of each cell just to know if
> > it is near to the center or peripheral (near to the edge).
> >
> > Thank you in advance,
> >
> > This is my macro to locate nuclei and i attach some example image .
> >
> >
> > --
> >
> >    - 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
> >
>
>
>
> --
>
>    - 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
>



--

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

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

Re: Edge spots to center

Volko Straub
Dear Adrian,

The macro I posted previously should print out a list of all particles with their coordinates and distance to centre of the islet, not just the first one. If that is not the case, I suspect that you missed the curly bracket } at the end of the macro. If the for-loop is not closed by a curly bracket, it will only be executed once.
The last lines of the macro should be:

for(i=1;i<nResults;i++){
        d2c=sqrt(pow((getResult("XM",i)-cX),2)+pow((getResult("YM",i))-cY,2));
        print(i,getResult("XM",i),getResult("YM",i),d2c);
};

Hope this solves your problem,
Volko



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Adrián Villalba
Sent: 05 February 2018 19:40
To: [hidden email]
Subject: Re: Edge spots to center

Dear Volko,

Thank you for your help. Regarding to your explanation, do you know if i can have the distance (as i have in the second line, third value: 1
262.5332 198.2361 197.4768 ) for all the nuclei instead of only for the first?

Thanks!

2018-02-01 17:30 GMT+01:00 Straub, Volko A. (Dr.) <[hidden email]>:

> Dear Adrian,
>
> The first line in the log window (in your example: 357.3944 371.4366)
> contains the x and y coordinates of the centre of your islet.
> The second line (1 262.5332 198.2361 197.4768) starts with a running
> number corresponding to the position of measurement in the result
> table, so 1, 2, 3, etc.
> This is followed by the x and y coordinates of the centre of the first
> nucleus, here x=262.5332 and y=198.2361. The final value should be the
> distance of that nucleus to the centre of the islet.
>
> The results in the result table are stored in an array. The index of
> the first element of an array is 0 not 1, and the index of the last
> element in an array is number of array elements - 1. So, the element
> nResults doesn't exist in the result table, but points a new line for the next measurement.
>
> I hope this answers your questions. Let me know if there is anything else.
>
> Regards,
> Volko
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Adrián Villalba
> Sent: 01 February 2018 16:04
> To: [hidden email]
> Subject: Re: Edge spots to center
>
> Dear Dr. Straub,
>
> Thank you very much for your help and the modified macro. I want to
> ask you about the center mass of the islet in coordinates.
> When i run:
>
> run("Set Measurements...", "center redirect=None decimal=1");
> run("Measure");  //provides coordinates of centre of mass for islet
> cX=getResult("XM",nResults-1); cY=getResult("YM",nResults-1);
> print(cX,cY);
>
> I get something like that:
>
> 357.3944 371.4366
> 1 262.5332 198.2361 197.4768
>
> I guess that the two first numbers (in this case the first printed
> line:  357.3944
> 371.4366) are those corresponding to the x,y coordinates of the center.
>
> But i do not understand he second line. Finally, why do you getResult
> with nResults-1?
>
> The macro runs and works perfectly, and i checked it with more than
> one picture and the results are the expected. Thank you very much for
> your time, help and attention. My questions are -just to know or
> curiosity questions - to understand better such great work.
>
> Thank you very much again Dr Straub.
>
>
> 2018-02-01 9:47 GMT+01:00 Straub, Volko A. (Dr.) <[hidden email]>:
>
> > Dear Adrian,
> > You can get the coordinates of the centre of mass for your Islet
> > selection by including run("Set Measurements...", "center
> > redirect=None decimal=1"); run("Measure"); in your code.
> > Using the Particle Analyzer after finding your nuclei can give you a
> > list of the coordinates of all your nuclei; include run("Analyze
> > Particles...", "display"); after your findMaxima statement
> >
> > You can then calculate the distance between each nucleus and the
> > centre of between the individual nuclei.
> >
> > The modified macro below prints a list of the nuclei coordinates and
> > distances to centre of islet to the log window. The first line are
> > the coordinates of the centre of mass for the islet.
> >
> > Hope this helps,
> > Volko
> >
> > 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"); run("Set Measurements...", "center redirect=None
> > decimal=1"); run("Measure");  //provides coordinates of centre of
> > mass for islet cX=getResult("XM",nResults-1);
> > cY=getResult("YM",nResults-1); print(cX,cY);
> >
> > 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("Close-"); run("Fill Holes"); run("Watershed"); run("Find
> > Maxima...", "noise=1 output=[Point Selection] light"); run("Analyze
> > Particles...", "display"); //provides list of coordinates of centre
> > of mass for each nucleus for(i=1;i<nResults;i++){
> > d2c=sqrt(pow((getResult("XM",i)-cX),2)+pow((getResult("YM",i))-cY,2)
> > );
> > //distance to centre of islet
> > print(i,getResult("XM",i),getResult("YM",i),d2c);
> > }
> >
> > -----Original Message-----
> > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf
> > Of Adrián Villalba
> > Sent: 31 January 2018 23:02
> > To: [hidden email]
> > Subject: Edge spots to center
> >
> >  Dear all,
> >
> > I have a macro that locate the nuclei of each cell within an area
> > (green, insulin positive area). I would be very pleased to know if
> > it is possible to determine how long or which distance there is
> > beween each nuclei and the geometric center of that green area. It
> > is something like to know the distribution of each cell just to know
> > if it is near to the center or peripheral (near to the edge).
> >
> > Thank you in advance,
> >
> > This is my macro to locate nuclei and i attach some example image .
> >
> >
> > --
> >
> >    - 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
> >
>
>
>
> --
>
>    - 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
>



--

   - 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