Quantcast

Counting spots within nuclei

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Counting spots within nuclei

Knecht, David
I need some help with a project one of my users would like to do.  They are doing medium throughput screening for nuclear segregation defects.  The samples are stained and then a nuclear image (DAPI) and a protein immunofluorescence image is collected.  In wild-type there is one protein spot per nucleus.  In a mutant, there are multiple spots per nucleus or none.  THere are 50-100 nuclei per image and each image represents a putative mutant. We have used the Find Maximum command to effectively count the total number of spots per field, but it turns out to not be enough information (since some with two spots and some with zero spots is the same as wild-type). They would like to generate a histogram of the distribution of spot numbers per nucleus for each image since a mutant would be skewed away from one.  Is there a way to use the nuclear image to define the area of each nucleus and then count spots in each individual nucleus so that the distribution can be plotted in Excel etc.?  Thanks- Dave

Dr. David Knecht    
Department of Molecular and Cell Biology
Co-head Flow Cytometry and Confocal Microscopy Facility
U-3125
91 N. Eagleville Rd.
University of Connecticut
Storrs, CT 06269
860-486-2200
860-486-4331 (fax)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Counting spots within nuclei

fabrice senger-2
Hi,
I had those kind of questions allready.
I first binarized the image based on the dapi staining and next converted
those into ROIs.
Thus for each nuclei i can generate a single image. Next you can count the
spots in each nuclei...this can be done in batch.

Best,

Fabrice.

2011/8/6 David Knecht charter <[hidden email]>

> I need some help with a project one of my users would like to do.  They are
> doing medium throughput screening for nuclear segregation defects.  The
> samples are stained and then a nuclear image (DAPI) and a protein
> immunofluorescence image is collected.  In wild-type there is one protein
> spot per nucleus.  In a mutant, there are multiple spots per nucleus or
> none.  THere are 50-100 nuclei per image and each image represents a
> putative mutant. We have used the Find Maximum command to effectively count
> the total number of spots per field, but it turns out to not be enough
> information (since some with two spots and some with zero spots is the same
> as wild-type). They would like to generate a histogram of the distribution
> of spot numbers per nucleus for each image since a mutant would be skewed
> away from one.  Is there a way to use the nuclear image to define the area
> of each nucleus and then count spots in each individual nucleus so that the
> distribution can be plotted in Excel etc.?  Thanks- Dave
>
> Dr. David Knecht
> Department of Molecular and Cell Biology
> Co-head Flow Cytometry and Confocal Microscopy Facility
> U-3125
> 91 N. Eagleville Rd.
> University of Connecticut
> Storrs, CT 06269
> 860-486-2200
> 860-486-4331 (fax)
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Counting spots within nuclei

Knecht, David
Hi Fabrice- I got the binary ROI's of the nuclei added to the manager, but I am not sure how to now analyze those ROI's in the protein channel to count the spots/nucleus.  Do you have a sample batch macro I can look at to modify?  Thanks- Dave

On Aug 6, 2011, at 6:20 PM, fabrice senger wrote:

> Hi,
> I had those kind of questions allready.
> I first binarized the image based on the dapi staining and next converted
> those into ROIs.
> Thus for each nuclei i can generate a single image. Next you can count the
> spots in each nuclei...this can be done in batch.
>
> Best,
>
> Fabrice.
>
> 2011/8/6 David Knecht charter <[hidden email]>
>
>> I need some help with a project one of my users would like to do.  They are
>> doing medium throughput screening for nuclear segregation defects.  The
>> samples are stained and then a nuclear image (DAPI) and a protein
>> immunofluorescence image is collected.  In wild-type there is one protein
>> spot per nucleus.  In a mutant, there are multiple spots per nucleus or
>> none.  THere are 50-100 nuclei per image and each image represents a
>> putative mutant. We have used the Find Maximum command to effectively count
>> the total number of spots per field, but it turns out to not be enough
>> information (since some with two spots and some with zero spots is the same
>> as wild-type). They would like to generate a histogram of the distribution
>> of spot numbers per nucleus for each image since a mutant would be skewed
>> away from one.  Is there a way to use the nuclear image to define the area
>> of each nucleus and then count spots in each individual nucleus so that the
>> distribution can be plotted in Excel etc.?  Thanks- Dave
>>
>> Dr. David Knecht
>> Department of Molecular and Cell Biology
>> Co-head Flow Cytometry and Confocal Microscopy Facility
>> U-3125
>> 91 N. Eagleville Rd.
>> University of Connecticut
>> Storrs, CT 06269
>> 860-486-2200
>> 860-486-4331 (fax)
>>

Dr. David Knecht    
Department of Molecular and Cell Biology
Co-head Flow Cytometry and Confocal Microscopy Facility
U-3125
91 N. Eagleville Rd.
University of Connecticut
Storrs, CT 06269
860-486-2200
860-486-4331 (fax)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Counting spots within nuclei

Gabriel Landini
On Sunday 07 Aug 2011, David Knecht charter wrote:
> Hi Fabrice- I got the binary ROI's of the nuclei added to the manager, but
> I am not sure how to now analyze those ROI's in the protein channel to
> count the spots/nucleus.  Do you have a sample batch macro I can look at
> to modify?  Thanks- Dave

If you have the nuclear binary profiles and the binarised spots in another
channel, you can subtract the spots from the nuclei so each nucleus will have
as many holes as spots. Then you can use the "ParticleHoleNumber.txt" macro
from the morphology collection available at:
http://www.dentistry.bham.ac.uk/landinig/software/software.html
to count how many holes there are in each nucleus.
That macro generates a table where the column GrIntDen is the number of holes
in the particle.

Please be aware that most of the macros in there expect white particles on
black background.

Cheers
Gabriel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Counting spots within nuclei

Peter Haub
In reply to this post by Knecht, David
Hi David,

here is a possible solution.
Copy the following code into a file named 'CountCellMaxi_.java', stored
it in the IJ plugins folder and use the command 'Plugins / Compile and
Run' to compile it to a class file.
Now you can use it interactively or in a macro code.
the Input has to be:
     - Current image = signal image as 8bit grayscale
     - Roi Manager with cell rois has to be open
Modify the code according to your needs.

Regards,
Peter

  /*********************************************
import ij.IJ;
import ij.ImagePlus;
import ij.plugin.filter.MaximumFinder;
import ij.plugin.filter.PlugInFilter;
import ij.plugin.frame.RoiManager;
import ij.process.ImageProcessor;

/**
Count the maxima in in individual cells.

Input:
     - Current image = signal image as 8bit grayscale
     - Roi Manager with cell rois has to be open

Output in log window:
     - Image name
     - Roi number and number of maxima

Macro call:
     run("CountCellMaxi ");

Author: Peter Haub 08/2011
**/

public class CountCellMaxi_ implements PlugInFilter{

     ImagePlus imp;
     double tolerance = 10.0;
     double threshold = 20.0;

     public int setup(String arg, ImagePlus imp) {
         this.imp = imp;
         return DOES_ALL;
     }

     public void run(ImageProcessor ip) {

         // check image
         if (imp.getType() != ImagePlus.GRAY8){
             IJ.log("8bit grayscale image required");
             return;
         }
         // Check if Roi Manager is open
         RoiManager roiM = RoiManager.getInstance();
         if (roiM == null){
             IJ.log(imp.getTitle() + ": No Roi's");
             return;
         }

         IJ.log("Img: " + imp.getTitle());
         MaximumFinder maxF = new MaximumFinder();
         int idxMax = roiM.getCount();
         for (int i=0; i<idxMax; i++){
             roiM.select(i);
             // find & count maxima per cell/roi
             ImageProcessor ipFM = ip.duplicate();
             ipFM = maxF.findMaxima(ip, tolerance, threshold, 0, false,
false);
             byte[] pFM = (byte[]) ipFM.getPixels();
             int cnt = 0;
             for (int n=0; n<pFM.length; n++)
                 if (pFM[n] != 0) cnt++;
             // log result
             IJ.log("Cell/Roi: " + (i+1) + "   Nmax: " + cnt);
         }
     }
}
/**********************************************

On 06.08.2011 13:26, David Knecht charter wrote:

> I need some help with a project one of my users would like to do.  They are doing medium throughput screening for nuclear segregation defects.  The samples are stained and then a nuclear image (DAPI) and a protein immunofluorescence image is collected.  In wild-type there is one protein spot per nucleus.  In a mutant, there are multiple spots per nucleus or none.  THere are 50-100 nuclei per image and each image represents a putative mutant. We have used the Find Maximum command to effectively count the total number of spots per field, but it turns out to not be enough information (since some with two spots and some with zero spots is the same as wild-type). They would like to generate a histogram of the distribution of spot numbers per nucleus for each image since a mutant would be skewed away from one.  Is there a way to use the nuclear image to define the area of each nucleus and then count spots in each individual nucleus so that the distribution can be plotted in Excel etc.?  Thanks- Dave
>
> Dr. David Knecht
> Department of Molecular and Cell Biology
> Co-head Flow Cytometry and Confocal Microscopy Facility
> U-3125
> 91 N. Eagleville Rd.
> University of Connecticut
> Storrs, CT 06269
> 860-486-2200
> 860-486-4331 (fax)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Counting spots within nuclei

Peter Haub
ps: The cell ROIs can be created by thresholding the DAPI image and
utilizing the ParticleManager.

On 07.08.2011 18:25, Peter Haub wrote:

> Hi David,
>
> here is a possible solution.
> Copy the following code into a file named 'CountCellMaxi_.java',
> stored it in the IJ plugins folder and use the command 'Plugins /
> Compile and Run' to compile it to a class file.
> Now you can use it interactively or in a macro code.
> the Input has to be:
>     - Current image = signal image as 8bit grayscale
>     - Roi Manager with cell rois has to be open
> Modify the code according to your needs.
>
> Regards,
> Peter
>
>  /*********************************************
> import ij.IJ;
> import ij.ImagePlus;
> import ij.plugin.filter.MaximumFinder;
> import ij.plugin.filter.PlugInFilter;
> import ij.plugin.frame.RoiManager;
> import ij.process.ImageProcessor;
>
> /**
> Count the maxima in in individual cells.
>
> Input:
>     - Current image = signal image as 8bit grayscale
>     - Roi Manager with cell rois has to be open
>
> Output in log window:
>     - Image name
>     - Roi number and number of maxima
>
> Macro call:
>     run("CountCellMaxi ");
>
> Author: Peter Haub 08/2011
> **/
>
> public class CountCellMaxi_ implements PlugInFilter{
>
>     ImagePlus imp;
>     double tolerance = 10.0;
>     double threshold = 20.0;
>
>     public int setup(String arg, ImagePlus imp) {
>         this.imp = imp;
>         return DOES_ALL;
>     }
>
>     public void run(ImageProcessor ip) {
>
>         // check image
>         if (imp.getType() != ImagePlus.GRAY8){
>             IJ.log("8bit grayscale image required");
>             return;
>         }
>         // Check if Roi Manager is open
>         RoiManager roiM = RoiManager.getInstance();
>         if (roiM == null){
>             IJ.log(imp.getTitle() + ": No Roi's");
>             return;
>         }
>
>         IJ.log("Img: " + imp.getTitle());
>         MaximumFinder maxF = new MaximumFinder();
>         int idxMax = roiM.getCount();
>         for (int i=0; i<idxMax; i++){
>             roiM.select(i);
>             // find & count maxima per cell/roi
>             ImageProcessor ipFM = ip.duplicate();
>             ipFM = maxF.findMaxima(ip, tolerance, threshold, 0, false,
> false);
>             byte[] pFM = (byte[]) ipFM.getPixels();
>             int cnt = 0;
>             for (int n=0; n<pFM.length; n++)
>                 if (pFM[n] != 0) cnt++;
>             // log result
>             IJ.log("Cell/Roi: " + (i+1) + "   Nmax: " + cnt);
>         }
>     }
> }
> /**********************************************
>
> On 06.08.2011 13:26, David Knecht charter wrote:
>> I need some help with a project one of my users would like to do.  
>> They are doing medium throughput screening for nuclear segregation
>> defects.  The samples are stained and then a nuclear image (DAPI) and
>> a protein immunofluorescence image is collected.  In wild-type there
>> is one protein spot per nucleus.  In a mutant, there are multiple
>> spots per nucleus or none.  THere are 50-100 nuclei per image and
>> each image represents a putative mutant. We have used the Find
>> Maximum command to effectively count the total number of spots per
>> field, but it turns out to not be enough information (since some with
>> two spots and some with zero spots is the same as wild-type). They
>> would like to generate a histogram of the distribution of spot
>> numbers per nucleus for each image since a mutant would be skewed
>> away from one.  Is there a way to use the nuclear image to define the
>> area of each nucleus and then count spots in each individual nucleus
>> so that the distribution can be plotted in Excel etc.?  Thanks- Dave
>>
>> Dr. David Knecht
>> Department of Molecular and Cell Biology
>> Co-head Flow Cytometry and Confocal Microscopy Facility
>> U-3125
>> 91 N. Eagleville Rd.
>> University of Connecticut
>> Storrs, CT 06269
>> 860-486-2200
>> 860-486-4331 (fax)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Counting spots within nuclei

Jeff C Hanson
In reply to this post by Knecht, David
David -
        One more option for counting spots in nuclei is to use the find
maxima to find a single point for each protein spot and then use the
redirect option with analyze particles to measure the intensity from the
single point image.  This "intensity" will correlate to the number of
protein spots.
        Here's a macro for it.  You'll need to add your own threshold or
segmentation for the DAPI image.  And, you'll need to set the "noise"
tolerance on the protein image to whatever works for your images...
// Select images to analyze
waitForUser("Click on DAPI image");
dapiID = getImageID();
waitForUser("Click on protein image");
proteinID = getImageID();

// Reduce protein image to a single point for each spot
selectImage(proteinID);
run("Find Maxima...", "noise=10 output=[Single Points]");
rename("Protein Points");
selectWindow("Protein Points");
proteinpointID = getImageID();

// Instead of "255" as the value of each point, reduce them to "1" for
each point
selectImage(proteinpointID);
run("Divide...", "value=255");

// Use redirection with analyze particles and integrated density to count
number of spots per nuclei
selectImage(dapiID);
run("Set Measurements...", "area integrated redirect=[Protein Points]
decimal=3");
run("Analyze Particles...", "size=100-Infinity circularity=0.00-1.00
show=Nothing display");

// Close the "single protein points" image
selectImage(proteinpointID);
close();

Jeff Hanson
Senior Imaging Analyst
Eli Lilly and Company



David Knecht charter <[hidden email]>
Sent by: ImageJ Interest Group <[hidden email]>
08/06/2011 07:26 AM
Please respond to
ImageJ Interest Group <[hidden email]>


To
<[hidden email]>
cc

Subject
Counting spots within nuclei






I need some help with a project one of my users would like to do.  They
are doing medium throughput screening for nuclear segregation defects. The
samples are stained and then a nuclear image (DAPI) and a protein
immunofluorescence image is collected.  In wild-type there is one protein
spot per nucleus.  In a mutant, there are multiple spots per nucleus or
none.  THere are 50-100 nuclei per image and each image represents a
putative mutant. We have used the Find Maximum command to effectively
count the total number of spots per field, but it turns out to not be
enough information (since some with two spots and some with zero spots is
the same as wild-type). They would like to generate a histogram of the
distribution of spot numbers per nucleus for each image since a mutant
would be skewed away from one.  Is there a way to use the nuclear image to
define the area of each nucleus and then count spots in each individual
nucleus so that the distribution can be plotted in Excel etc.?  Thanks-
Dave

Dr. David Knecht
Department of Molecular and Cell Biology
Co-head Flow Cytometry and Confocal Microscopy Facility
U-3125
91 N. Eagleville Rd.
University of Connecticut
Storrs, CT 06269
860-486-2200
860-486-4331 (fax)
Loading...