Chromosome counting and masking help


I’m having some trouble with creating masks for automating the counts of chromosomes in mouse cells. Here is the image I start with (it’s a jpg unfortunately):

I start out processing it with a gaussian blur (3 sigma), and a kuwahara filter (5 sampling window width), and then an auto local threshold (phansalkar, radius of 15, white objects on black background), and wind up with a mask that looks like this:

Apologies for using a jpg for this image as well, but the tif won’t upload for some reason.

I’m trying to get ROIs around the V-shaped objects in the middle of this image, but I’m having trouble with watershedding them correctly and avoiding the large, non-mitotic nuclei in the image. I’ve tried playing with the irregular watershedding without much success.

Any thoughts?

Thank you,

Hi @EBritigan

So the good news - I wasn’t able to get a ‘better’ segmentation than you - so I’d guess you are really on the right track for segmenting your chromosomes. :slight_smile:

It’s true that due to the V-shape of these objects, watershedding will be tough and might not work, as it is more applicable to circular objects.

The only things I can point you to are Extended Analyze Particles and the Watershed Irregular Features from the Biovoxxel Toolbox - you can always filter out objects based on size to avoid those larger objects in your image… But it sounds like you tried this already?

What exactly didn’t work for you in your irregular watershedding? What tool did you use for this?

eta :slight_smile:

1 Like


Too - you could check out Morphological Segmentation with MorphoLibJ … just another great tool/option in ImageJ/Fiji that you might find helpful in your case.

eta :slight_smile:

This seems like it could potentially be a good example to demonstrate deep learning for biology.

(it is simple enough that one could expect reasonable performance, given a small training set, and thus it would a fun example to experiment with quickly, though it wouldn’t show the full power of deep learning)

@dietzc, @tibuch Is possible to use the KNIME ND4J integration to do pixel based classificaiton??

I tried to do it, but could only figure out how to image classification and not pixel based.

I did use weka segmentation and that looks like it would actually get you there, maybe with some subsequent binary operations, and object filtering…


Hi EBritigan,

If you just want to “count” the total amount of targets, I tried to use “Subtract Background” then “Find Maxima” to the image. Hopefully, that could give you some ideas.


@dietzc, @tibuch Is possible to use the KNIME ND4J integration3 to do pixel based classificaiton??

Not yet :slight_smile:

Thanks for all of the feedback!

I was having trouble figuring out how to adjust the watershed irregular features tool. I’ve been playing with the parameters, but I’m not entirely sure what I’m adjusting and I’m unable to get better results than the normal watershedding at this point. Any tips on adjustments for it?

I just started trying out the morphological segmentation, but I’m running into the same issue where it segments my chromosomes into multiple areas. Any suggestions for adjustments or filters that work better with that tool?

Thank you,

This definitely works quite well as long as you select an area to look in. I’m hoping to make this a batch process eventually, so having to select an ROI is not ideal. If there’s a good way to avoid the other nuclei in an image though, this would be perfect!

Is it possible to make a region of interest around the large, non-mitotic, nuclei and then invert the selection? That might do the trick.

This looks a lot better than what I could get when trying the weka segmentation. Would you mind sharing the setting you used for this and the selections you used for training?

Thank you!

And sorry for the separate replies, I’ll just do them all at once next time.


Hi @EBritigan

Here is a screen shot of my Weka classes. I found the key was to trace a ‘background’ example, right on the border of the object, as to emphasize the boundary of the object. I traced a couple background sections, and a couple chromosomes, looked at the result, then iterated, tracing again where it made mistakes. I was careful to NOT trace any of the chromosomes in the lower part of the image (especially in the big clump) as I didn’t overtrain on the difficult part.

Attached are the saved classifier and data (3.9 MB)