Hi All,
I am trying to automate the detection of cell clusters based upon my specified cell density. Optimally, this macro would enable imagej to detect these clusters, outline the area, and calculate the number of cells in this region and divide by the area (to determine the area fraction). My attempts thus far have included thresholding to show the cells, running particle analysis to try and count the cells, using the cell counter and nuclei counter to find the cells, and I have even tried using the grid plugin to try to determine number of cells per grid location (similar to using a hemocytometer). None of these have proven successful in being able to either determine cell density, or outline groups based upon density values that I provide. I believe that there should be some way to get the cell counter and grid plugins to work together in this fashion. I am open to any and all suggestions! Thanks! |
Dear Machado,
What type of images do you have? DIC, Fluorescence,...? Could you supply some samples? Best wishes Kees Dr Ir K.R. Straatman Senior Experimental Officer Centre for Core Biotechnology Services University of Leicester http://www.le.ac.uk/biochem/microscopy/home.html ImageJ workshops 29 and 30 July 2013 visit: http://www.le.ac.uk/biochem/microscopy/ImageJ2013.html ________________________________________ From: ImageJ Interest Group [[hidden email]] On Behalf Of Machado [[hidden email]] Sent: 11 May 2013 00:44 To: [hidden email] Subject: Outline Area of Specific Cell Density Hi All, I am trying to automate the detection of cell clusters based upon my specified cell density. Optimally, this macro would enable imagej to detect these clusters, outline the area, and calculate the number of cells in this region and divide by the area (to determine the area fraction). My attempts thus far have included thresholding to show the cells, running particle analysis to try and count the cells, using the cell counter and nuclei counter to find the cells, and I have even tried using the grid plugin to try to determine number of cells per grid location (similar to using a hemocytometer). None of these have proven successful in being able to either determine cell density, or outline groups based upon density values that I provide. I believe that there should be some way to get the cell counter and grid plugins to work together in this fashion. I am open to any and all suggestions! Thanks! -- View this message in context: http://imagej.1557.x6.nabble.com/Outline-Area-of-Specific-Cell-Density-tp5002970.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 |
In reply to this post by Machado
Hi Machado,
If you can get the cells binariezed (which it sounds like you can) then you can use the process-->binary-->distance map. This will give you a Euclidean distance map. This is an intensity weighted image were your objects are made an intensity of 0 and each pixel away from them is increased in intensity by 1. Once you have a distance map you an set a threshold value to select all cells that are a given number of pixels apart (i.e clumps of cells). Cheers Cam Cameron J. Nowell Centre for Dynamic Imaging The Walter and Eliza Hall Institute of Medical Research 1G Royal Parade Parkville, Victoria 3052 Australia Phone: +61 3 9345 2871 Mobile: +61422882700 Fax: +61 3 9347 0852 Facility Website LinkedIn Profile -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Machado Sent: Saturday, 11 May 2013 9:45 AM To: [hidden email] Subject: Outline Area of Specific Cell Density Hi All, I am trying to automate the detection of cell clusters based upon my specified cell density. Optimally, this macro would enable imagej to detect these clusters, outline the area, and calculate the number of cells in this region and divide by the area (to determine the area fraction). My attempts thus far have included thresholding to show the cells, running particle analysis to try and count the cells, using the cell counter and nuclei counter to find the cells, and I have even tried using the grid plugin to try to determine number of cells per grid location (similar to using a hemocytometer). None of these have proven successful in being able to either determine cell density, or outline groups based upon density values that I provide. I believe that there should be some way to get the cell counter and grid plugins to work together in this fashion. I am open to any and all suggestions! Thanks! -- View this message in context: http://imagej.1557.x6.nabble.com/Outline-Area-of-Specific-Cell-Density-tp5002970.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html ______________________________________________________________________ The information in this email is confidential and intended solely for the addressee. You must not disclose, forward, print or use it without the permission of the sender. ______________________________________________________________________ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Krs5
The images that I'm working with are just white light images of tissue sections stained with H&E. I've attached a sample image for you to take a look. You can see congregations of nuclei near the tissue border, which is where I am trying to outline/determine cell density and the area fraction.
![]() Thanks for the help! Mike Mike Machado Research Associate J. David Gladstone Institutes Institute of Neurological Disease San Francisco, CA |
In reply to this post by Cameron Nowell
Hi Cam,
This sounds like a great idea, but I can't get the distance map to recognize the correct cell clusters. In the images below, you can see the distance map that I created, and the thresholded image. It seems to be picking up on some noise near the middle of the tissue section. In the third image, I've just changed the type to 8-bit, and then thresholded to determine the cell clusters as I see them (Default, B&W, 0, 120). Of course, converting this to a binary image removes this threshold. Is there a way to use the 8-bit thresholded image that I've created and still create a distance map of sorts? Or perhaps use the grid to output number of cells per grid location? My thinking is that I could write something into the macro at this point to recognize my "cell cluster" specification (e.g. >10 cells/grid), and then either highlight these portions of the grid, or fill in the other grid squares in order to get an area value for these cluster-positive locations. Thanks! Mike ![]() ![]() ![]() Mike Machado Research Associate J. David Gladstone Institutes Institute of Neurological Disease San Francisco, CA |
Hi Mike,
Have a look at the binary image here https://dl.dropboxusercontent.com/u/11163658/TEST.jpg-%28Colour_1%29%20Maxima.tif I used the test image you uploaded and did the following. A couple of notes, firstly I am using the Fiji distribution (www.fiji.sc) of imagej so you may not have the plugins or filters I used. Secondly the image is a very low res, the nuclei only have a couple of pixels in them so it makes finer detailed selection hard. But give this a go and see what you think. 1. Colour deonconvolve the image. Image --> Colour --> Colour Deconvolution. Set the vectors to H and E. you will get three images. Colour 1 is the haemotoxylin channel, colour two is the eosin and colour 3 is essentialy a mathematical remainder. If you look at colour 2 you can see the clumps already, you could threshold this and just measure that but it won't give cell number etc. 2. Select the Colour 1 image, invert it (Edit --> Invert) and set the LUT to gray. This is purely for aesthetics, I just find it easier to work on "fluorescent type images". 3. Flatten background (Process --> Subtract Background) using a 50px rolling ball and all other options disabled 4. Detect the individual nuclei with the find maxima command (Process --> Find Maxima), set the noise tolerance to 15 and set the output type to single points 5. Duplicate the single points output for later. 6. select one of the single point images and invert it (edit --> Invert) now apply the distance map to this inverted image (process --> binary --> distance map). Now invert this result (edit --> invert). 7. The resulting image won't look great, you can adjust the brightness and contrast a bit but it will still look mostly saturated. But it doesn't matter it will do the job it's supposed to. 8. Set a threshold on the final distance map image of 253-255 and apply it to get a binary image. 9. Now run an Open filter on the binary image by going to Process-->Binary-->options. Set iterations to 2 and count to 1, tick black background and chose do to be open. 10. you now have a mask to use for further analysis. I had a quick play and did the following. 11. Use the analyse particles option to exclude the smaller single clumps (size 30-infinity). Out put the results to the ROI manager (tick the add to manager box). 12. now select the other single points image you duplicated earlier. Select the roi manager and tick the show all box to make the regions appear on it. Now set your measurementsanal (analyse --> set measurments) to measure just integrated intensity. Now click the more>> button on the ROI manager and select multi measure. 13 the results will be a totally/integrated intensity for each ROI. As the image measured was single pixels of 255 intenisty, dividing the result by 255 will tell you how many points/cells per cluster. Cheers Cam Cameron J. Nowell Centre for Dynamic Imaging The Walter and Eliza Hall Institute of Medical Research 1G Royal Parade Parkville, Victoria 3052 Australia Phone: +61 3 9345 2871 Mobile: +61422882700 Fax: +61 3 9347 0852 Facility Website LinkedIn Profile -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Machado Sent: Tuesday, 14 May 2013 2:40 AM To: [hidden email] Subject: Re: Outline Area of Specific Cell Density Hi Cam, This sounds like a great idea, but I can't get the distance map to recognize the correct cell clusters. In the images below, you can see the distance map that I created, and the thresholded image. It seems to be picking up on some noise near the middle of the tissue section. In the third image, I've just changed the type to 8-bit, and then thresholded to determine the cell clusters as I see them (Default, B&W, 0, 120). Of course, converting this to a binary image removes this threshold. Is there a way to use the 8-bit thresholded image that I've created and still create a distance map of sorts? Or perhaps use the grid to output number of cells per grid location? My thinking is that I could write something into the macro at this point to recognize my "cell cluster" specification (e.g. >10 cells/grid), and then either highlight these portions of the grid, or fill in the other grid squares in order to get an area value for these cluster-positive locations. Thanks! Mike <http://imagej.1557.x6.nabble.com/file/n5002981/TEST1.jpg> <http://imagej.1557.x6.nabble.com/file/n5002981/TEST2.jpg> <http://imagej.1557.x6.nabble.com/file/n5002981/TEST3.jpg> Mike Machado Research Associate J. David Gladstone Institutes Institute of Neurological Disease San Francisco, CA -- View this message in context: http://imagej.1557.x6.nabble.com/Outline-Area-of-Specific-Cell-Density-tp5002970p5002981.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html ______________________________________________________________________ The information in this email is confidential and intended solely for the addressee. You must not disclose, forward, print or use it without the permission of the sender. ______________________________________________________________________ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Cam,
Thank you for that incredibly detailed guide! I went through it with my sample image (I have a very high resolution version here) to see what I could get. I'm not sure if it was something that I did, or if it had to do with the change in image resolution, but there was still quite a bit of noise that disallowed me from getting cluster information. I think that I will just have to bite the bullet and mark the clusters by hand after thresholding. Again, thank you for your help, it was really appreciated! Mike Mike Machado Research Associate J. David Gladstone Institutes Institute of Neurological Disease San Francisco, CA |
Hi Mike,
No worries. It may just be that a few other filters are needed to get rid of the noise from the larger images. Can you upload one to dropbox or something and I can have a look. All the filter sizes I mentioned in my description were for the image size you shared. They would need to be increased for a larger resolution image. Cheers Cam -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Machado Sent: Wednesday, 15 May 2013 2:09 AM To: [hidden email] Subject: Re: Outline Area of Specific Cell Density Hi Cam, Thank you for that incredibly detailed guide! I went through it with my sample image (I have a very high resolution version here) to see what I could get. I'm not sure if it was something that I did, or if it had to do with the change in image resolution, but there was still quite a bit of noise that disallowed me from getting cluster information. I think that I will just have to bite the bullet and mark the clusters by hand after thresholding. Again, thank you for your help, it was really appreciated! Mike Mike Machado Research Associate J. David Gladstone Institutes Institute of Neurological Disease San Francisco, CA -- View this message in context: http://imagej.1557.x6.nabble.com/Outline-Area-of-Specific-Cell-Density-tp5002970p5002994.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html ______________________________________________________________________ The information in this email is confidential and intended solely for the addressee. You must not disclose, forward, print or use it without the permission of the sender. ______________________________________________________________________ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |