Creating a cell counting algorithm that works on .tif files with multiple stacked components

I’m new to ImageJ and I have no idea what I’m doing. I managed to cobble together this procedure together.

Creating an ROI Selection

  1. Open the first filter image

  2. Make adjustments to the filter if needed.

  3. To adjust the brightness/contrast, go to Image → Adjust → Brightness/Contrast

  4. Select the “Freehand selections” tool on the toolbar. Hold alt and make a selection within your first selection in order to subtract it.

  5. Draw a selection

  6. Process → Binary → Options → Select “Black Background” and Apply

  7. Black background should already be selected by default.

  8. Edit → Selection → Create Mask

  9. Take the mask you created and follow these steps:

  10. Process → Math → Divide by 255 (The image will turn black)

  11. Save mask by going to Save or Ctrl + S

  12. Go back to the first filter image and following these steps:

  13. Process → Image Calculator and multiply the current image by the mask you

  14. created

Counting Cells

  1. You should be on the image that was created after the step 8 of the last section.

  2. Edit → Options → Conversions and select “scale when converting”

  3. Image → Type → 16-bit (to convert to grayscale image)

  4. Image → Adjust → Threshold → Adjust the sliders to highlight cells in red and select Apply

  5. Before you select Apply, you should have a black background tissue and red cells.

  6. Process → Binary → Watershed

  7. This will separate cells that are in clusters.

  8. Process → Binary → Open

  9. This will remove background specks. If you are unhappy with the results of this, you can change the “count” number under Process → Binary → Options. The higher the number, the less sensitive the operation.

  10. Analyze → Analyze particles and adjust settings (see below)

  11. Size: depends on the image (recommended lower bound: 10)

  12. Circularity: no change; leave as “0-1”

  13. Show masks

  14. Select the following checkboxes:

1. Display results
2. Clear results
3. Summarize
4. Add to manager
5. In situ show
  1. Save the resulting image

However, this only seems to work on single png or jpeg images, and I’d like a way to make it work on multicolor tif or nd2 image stacks. Is there any way to make this possible.

Thanks so much in advance,
Asher

Hi @Asher_Jaffe,

That’s true that’s cobbled!

Could you refine what is your image and what is your goal ?
A general scheme is filtering, segmenting and measuring, that’s true, but all this have to be customised.
And tiff, multicolor or nd2 files can be processed with ImageJ.

Nico