Custom Cell Detection

I would like to explore creating my own custom cell detection using different ImageJ filters and plugins for cases when the default cell detection does not perform adequately. Has anyone tried this before? A starting script in QuPath/ImageJ that I can modify would be very helpful.



The closest I have done is modify the java files used for cell detection such that I could use multiple brightfield color vectors for the nuclear detection. In general, sending results back from ImageJ as “detection” objects should get you started. There are multiple scripts in the Complex Scripts section that involve using ImageJ macros that take user input to modify the ImageJ commands that are run.

This shows the basic setup for running an ImageJ macro through a script.

A lot depends on how you are more comfortable developing your detection method. I’d suggest:

  • If you prefer ImageJ macros, use this on one or more cropped regions - once happy, we can figure out how to get the macro working with QuPath (there are already some options and posts)
  • If you prefer Java/Groovy, try writing a Groovy script for the detection, using either ImageJ or OpenCV as required - see here for some starting hints
  • If you prefer Python, try writing a Python script that uses OpenCV for processing - by restricting yourself to OpenCV as much as possible, it will be easier to translate the algorithm into a QuPath script later
  • If you prefer using ImageJ2 / ImgLib2 / SciJava scripting, develop your algorithm with Fiji & we can then try to figure out how to get it to work with QuPath
  • If you prefer something else entirely, we can still explore getting it to work with QuPath - possibly using binary/labelled images output from your code

Personally, I’d use Groovy + ImageJ. But I think it’s best to consider the task of getting the working algorithm and getting it into QuPath separately.


Thanks for the suggestions. This all makes sense and is definitely enough to get me started

I completely forgot about that posting on IJ processing of a whole image area. May have to play around with that more.