Luxol Fast Blue quantification with Color Deconvolution

Hi all,

My current project is to quantify the %area of tissue stained with Luxol Fast Blue, a histochemical stain for myelin (sample image below). It is also stained with hemotoxylin. My overall strategy, which works in ImageJ on smaller images, is to do color deconvolution (I created custom stain vectors and clumsily updated the native Colour Deconvolution with them), draw an ROI on the hemotoxylin channel to avoid bias, then threshold and count number of stained pixels on the LFB channel. However, I would like to upscale this to larger images, and am therefore getting QuPath involved. I can recreate the color deconvolution in QuPath fairly easily, but I had trouble finding a simple thresholding function based on only one stain vector, especially since cell detection is not involved in this analysis at all. So then I tried sending it to ImageJ, but I can’t get my updated Colour Deconvolution plugin to work in the QuPath form of ImageJ (I have it in a .java file…I think my trouble is I can’t get it to compile).

In summary, I think the two best options are to achieve the thresholding/quantification in QuPath or get my Colour Deconvolution file to compile in QuPath’s version of ImageJ. I greatly appreciate any advice you can share!

1 Like

Pete may have a better suggestion, but I would recommend going back to version 0.1.2 or 0.1.3 for very large images, and use the Positive Pixel Count tool in Analyze->Region Identification.

You can test out how it works in 0.2.0m8, but it may be a bit slow at the moment. I think it should be replaced at some point by Simple Thresholding, though at the moment color deconvolutions can’t be used there.

I would recommend creating a very small square and seeing if you can get the results you want in that small sample space. If it works, and works fast enough (you can allow enough blur/downsample and still get the results you need), you can try tiling your whole annotation and running it across all tiles.

There are a few other posts on using Positive pixel counts both on this forum and on the old Google groups forum.
Example of this in H-DAB



QuPath won’t be able to compile it, but if you can get it compiled in a ‘regular’ ImageJ installation you can set the plugins directory that QuPath uses for ImageJ. This should give you access to whatever extra plugins you have installed there.

If I remember correctly, the option is under both *Extensions → ImageJ → … * and also under Edit → Preferences….

Yes, that particular command doesn’t have a bright future. It doesn’t scale at all well to large images; I think pixel classification (including with a simple ‘classifier’ that is just a threshold) is a better way to approach it.

You could already try training a simple pixel classifier - it won’t use color deconvolution, but I don’t think that’s necessarily a bad thing.

1 Like

One issue with pixel classifiers in dye mixtures is that a given pixel is no really “one dye or the other”, but often a mixture that varies from place to place. It is quite revealing to look for example to an eosin-only stained section; it stains mostly everywhere to varying degrees, not so much with haematoxylin (of course this varies with the different staining methods). Segmenting an individual dye contribution could therefore be, in theory, more accurate as you make a decision based on the contribution of the dye you are interested in.
In this case, you might get a better separation if the dyes are not so close in the RGB space. For example a red dye instead of Haematoxylin might be easier to unmix from the luxol fast blue. Maybe you can try this on some new material and compare to the old. I would be interested to know what you get from such comparisons.

3 Likes

Thanks, everyone, for your suggestions! I finally got it to work by setting the plugins directory in QuPath (plus a bit more fiddling). Funny story is that I had already done that but was over-compartmentalizing (redirected to a new QuPath Plugin folder) and therefore lost whatever compilation magic had gotten it to work in vanilla ImageJ (can you tell I don’t have much background in computer science?).

Using the Positive Pixel Count strategy looks interesting and I am curious about how it works, but honestly it is difficult for me to get these workflows to work in the first place so I’ll probably just stick with the one that does.

Thanks again!

2 Likes