Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell detection does not work probably because of high DAB background. Help me please? #305

Closed
r5ljq opened this Issue Apr 14, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@r5ljq
Copy link

commented Apr 14, 2019

Hi everybody,

I have IHC images to analyze and it has high DAB background.

Probably because of the background, 'Cell detection' function does not work at all to detect any cells in the image even after changing the parameters.

Could anybody help how to train Qupath to detect cells in this case?

I attach my script below and an original image as well. Thanks!

Blank-C2M3.zip


setImageType('BRIGHTFIELD_H_DAB');
setColorDeconvolutionStains('{"Name" : "H-DAB modified", "Stain 1" : "Hematoxylin", "Values 1" : "0.71124 0.61052 0.34843 ", "Stain 2" : "DAB", "Values 2" : "0.10193 0.39945 0.91107 ", "Background" : " 225 175 148 "}');
runPlugin('qupath.imagej.detect.cells.WatershedCellDetection', '{"detectionImageBrightfield": "Hematoxylin OD", "requestedPixelSizeMicrons": 0.5, "backgroundRadiusMicrons": 8.0, "medianRadiusMicrons": 0.0, "sigmaMicrons": 1.5, "minAreaMicrons": 10.0, "maxAreaMicrons": 400.0, "threshold": 0.1, "maxBackground": 2.0, "watershedPostProcess": true, "excludeDAB": false, "cellExpansionMicrons": 5.0, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true}');

@Svidro

This comment has been minimized.

Copy link

commented Apr 14, 2019

I think the main problem is that your TIFF file was saved with incorrect pixel size information. Without that information it is very difficult to find settings that will work, though it is possible. Note that each one of your pixels is expected to be 163 um in size. Your entire image is about 0.2 meters in size.

If you are using the ImageJ server, everything needs to be in pixels instead, though since you have a requestedPixelSize entry, I am guessing that is not the case here.

If you are using a BioFormats server (see Image tab), you can get started with these settings, though I have not optimized them at all.

setImageType('BRIGHTFIELD_H_DAB');
createSelectAllObject(true);
setColorDeconvolutionStains('{"Name" : "H-DAB", "Stain 1" : "Hematoxylin", "Values 1" : "0.81041 0.56974 0.13652 ", "Stain 2" : "DAB", "Values 2" : "0.26524 0.50132 0.8236 ", "Background" : " 254 190 154 "}');
selectAnnotations();
runPlugin('qupath.imagej.detect.cells.WatershedCellDetection', '{"detectionImageBrightfield": "Optical density sum",  "requestedPixelSizeMicrons": 300.0,  "backgroundRadiusMicrons": 0.0,  "medianRadiusMicrons": 0.0,  "sigmaMicrons": 600.0,  "minAreaMicrons": 10000.0,  "maxAreaMicrons": 8.0E7,  "threshold": 0.1,  "maxBackground": 2.0,  "watershedPostProcess": true,  "excludeDAB": false,  "cellExpansionMicrons": 1000.0,  "includeNuclei": true,  "smoothBoundaries": true,  "makeMeasurements": true}');

Note the extremely large values in most measurements. It would be better to fix the pixel sizes in ImageJ, though.

@petebankhead

This comment has been minimized.

Copy link
Member

commented Apr 14, 2019

I looked at the image and there are two main problems:

  • The pixel size is completely off (169.3 μm). It looks like it was converted from a 'dots per inch' value used for printing resolution, but doesn't relate to the actual size of anything in the image.
  • The background is values in your script are much too low. Draw a rectangle in one of the small 'white' areas and double-click on the 'Background' values under the 'Image' tab to set them.

The first of these is the bigger problem. I don't know the source of your image, but ideally you'd be able to go back to it and save the file in a format that preserves the pixel size information properly.

Note: Please do not post the same question in multiple places. As described here and here, GitHub issues is intended for bug reports and not for questions.

@petebankhead

This comment has been minimized.

Copy link
Member

commented Apr 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.