How do I count the blue pixels of the image and the pink pixels of the image. I am trying to find out if the blue nuclei are increasing over the rest of the pink kidney tissue. I do not want the white pixels to be added to the analysis
You may need to calculate your own color vectors for best accuracy, but it sounds like you want Image->Color->Colour deconvolution.
That will give you a separate image per stain channel, which you can then threshold.
If your images are large, you might consider trying QuPath where these features are built in and can be visualized using the 1,2,3 keys.
There are many posts on the forum about color deconvolution and stain vectors, it is a good idea to take a look around so that you understand what you are using.
Quick example using a pixel classifier and the color deconvolution channels in QuPath. Not great since it is a low quality image posted on the forum, but it is something.
if I understood you correctly, you do want to get an information about the number of nuclei (or cells respectively) occurring in your section images under different conditions.
Then, counting “blue pixels” will not help you since it will maximally give you the area covered by nuclei, which is related to an increasing or decreasing cell number but might be misleading due to different nuclear sizes.
In my opinion, what would be a better way to answer that question in the current case is the actual number of cells (or nuclei, respectively).
Please try the following macro which might enable you to count them. It will not always work perfectly, if some are super crowded and it depends on the variability in your images as well.
You will need to install the Adjustable Watershed still in addition by hand first to make the macro work.
original = getTitle(); run("Duplicate...", "use"); run("Gamma...", "value=5"); run("HSB Stack"); setSlice(3); run("Duplicate...", "use"); run("Gaussian Blur...", "sigma=1"); run("Auto Threshold", "method=Intermodes"); run("Adjustable Watershed", "tolerance=0.1"); run("Analyze Particles...", "size=20-1000 circularity=0.25-1.00 exclude clear summarize add"); selectWindow(original); close("\\Others"); roiManager("Show All without labels");
Other than that, StarDist might also be a possibility to try.