Trouble with Positive Cell Detection in Tiff files

Hello,
I’m having trouble with Positive Cell Detection using QuPath v0.1.2
A few years ago, I analysed tiff files of H-DAB staining for CD4 and the positive cell detection was succesfully performed as shown below.


However, now when I try to run Positive Cell detection using both these or other measurements, QuPath does not show any detections. I have tried this on both the same image as well as DAB stained images of other markers (such as CD8) but there are no detections at all.
I’ve read that sometimes turning background ‘off’ also helps but that didn’t seem to work.
Could anyone please advise what other parameters could need adjusting and what the issue may be?
Many thanks.

Sample image and/or code

  • Upload an original image file here directly or share via a link to a file-sharing site (such as Dropbox) – (make sure however that you are allowed to share the image data publicly under the conditions of this forum).
  • Share a minimal working example of your macro code.

Background

  • What is the image about? Provide some background and/or a description of the image. Try to avoid field-specific “jargon”.

Analysis goals

  • What information are you interested in getting from this image?

Challenges

  • What stops you from proceeding?
  • What have you tried already?
  • Have you found any related forum topics? If so, cross-link them.
  • What software packages and/or plugins have you tried?

Are the images still being opened in the same way, ie with the same metadata? Is this a new installation of QuPath and if so have you added bioformats to it?

The toolbar is cropped off in the screenshot, but is it possible that the cells are simply hidden (green buttons in the middle of the toolbar / shortcut key D)?

It could also be that the image type is wrongly set to fluorescence, or that no region of interest annotation is drawn and selected.

The contents of View → Show log and of the ‘Hierarchy’ tab on the left of the screen may be informative to figure out what is going wrong.

Hi,
It’s the same project with the same qpdata files so I think it’s opening the same way. I’m attempting this in the same old version of QuPath in which the project was created

Hi Peter, I checked but the cells weren’t hidden. Image type also seems to be correctly identified as H-DAB and i annotated the whole image field using the rectangle tool before positive cell detection.
I just retried the analysis on the same image and this is what I found in Show log:
INFO: Refreshing extensions in C:\Users\r01mpc17\QuPath\extensions
INFO: Added extension: C:\Users\r01mpc17\QuPath\extensions\bioformats_package.jar
INFO: Added extension: C:\Users\r01mpc17\QuPath\extensions\qupath-extension-bioformats.jar
INFO: Bio-Formats version 6.1.1
INFO: Selected style: Modena Light
INFO: Performing update check…
INFO: Starting QuPath with parameters: [C:\Users\r01mpc17\Desktop\QuPath\CD4 Connective Tissue Oral Cavity\project.qpproj]
INFO: Trying to load project C:\Users\r01mpc17\Desktop\QuPath\CD4 Connective Tissue Oral Cavity\project.qpproj
INFO: Project set to Project: CD4 Connective Tissue Oral Cavity
WARN: Unable to open C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H ix\12541-16H ix.tif with OpenSlide: C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H ix\12541-16H ix.tif: Not a file that OpenSlide can recognize
INFO: TiffDelegateReader initializing C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H ix\12541-16H ix.tif
INFO: Reading IFDs
INFO: Populating metadata
INFO: Checking comment style
INFO: Populating OME metadata
INFO: Generating memoization file C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H ix.12541-16H ix.tif.bfmemo (0.04 MB)
WARN: Unable to parse magnification: null
INFO: Returning server: Bio-Formats for C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H ix\12541-16H ix.tif
INFO: Estimating H-DAB staining
INFO: Image data set to ImageData: Brightfield (H-DAB), 12541-16H ix
INFO: Reading data from 12541-16H ix.tif.qpdata…
INFO: Hierarchy with 287 object(s) read from C:\Users\r01mpc17\Desktop\QuPath\CD4 Connective Tissue Oral Cavity\data\12541-16H ix.tif.qpdata in 0.14 seconds
WARN: Unable to open C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iv\12541-16H iv.tif with OpenSlide: C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iv\12541-16H iv.tif: Not a file that OpenSlide can recognize
WARN: Unable to parse magnification: null
INFO: Returning server: Bio-Formats for C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iv\12541-16H iv.tif
INFO: Estimating H-DAB staining
INFO: Image data set to ImageData: Brightfield (H-DAB), 12541-16H iv
INFO: Reading data from 12541-16H iv.tif.qpdata…
INFO: Hierarchy with 423 object(s) read from C:\Users\r01mpc17\Desktop\QuPath\CD4 Connective Tissue Oral Cavity\data\12541-16H iv.tif.qpdata in 0.02 seconds
INFO: 0 nuclei detected (processing time: 2.51 seconds)
INFO: Processing complete in 2.52 seconds
INFO: Completed!
INFO:
qupath.imagej.detect.nuclei.PositiveCellDetection {“detectionImageBrightfield”: “Hematoxylin OD”, “requestedPixelSizeMicrons”: 0.5, “backgroundRadiusMicrons”: 15.0, “medianRadiusMicrons”: 0.0, “sigmaMicrons”: 3.0, “minAreaMicrons”: 10.0, “maxAreaMicrons”: 1000.0, “threshold”: 0.1, “maxBackground”: 2.0, “watershedPostProcess”: true, “excludeDAB”: false, “cellExpansionMicrons”: 5.0, “includeNuclei”: true, “smoothBoundaries”: true, “makeMeasurements”: true, “thresholdCompartment”: “Nucleus: DAB OD mean”, “thresholdPositive1”: 0.2, “thresholdPositive2”: 0.4, “thresholdPositive3”: 0.6, “singleThreshold”: true}
WARN: Unable to open C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iii\12541-16H iii.tif with OpenSlide: C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iii\12541-16H iii.tif: Not a file that OpenSlide can recognize
INFO: TiffDelegateReader initializing C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iii\12541-16H iii.tif
INFO: Reading IFDs
INFO: Populating metadata
INFO: Checking comment style
INFO: Populating OME metadata
INFO: No memoization file generated for C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iii\12541-16H iii.tif
WARN: Unable to parse magnification: null
INFO: Returning server: Bio-Formats for C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iii\12541-16H iii.tif
INFO: Estimating H-DAB staining
INFO: Image data set to ImageData: Brightfield (H-DAB), 12541-16H iii
INFO: Reading data from 12541-16H iii.tif.qpdata…
INFO: Hierarchy with 282 object(s) read from C:\Users\r01mpc17\Desktop\QuPath\CD4 Connective Tissue Oral Cavity\data\12541-16H iii.tif.qpdata in 0.01 seconds
WARN: Unable to parse magnification: null
INFO: Returning server: Bio-Formats for C:\Users\r01mpc17\Documents\IHC\IHC Analysis\Image Analysis\Sample Staining\CD4 Sample Staining\CD4 Oral Cavity\CD4 LGD Floor of Mouth\12541-16H\Connective Tissue\12541-16H iv\12541-16H iv.tif
INFO: Estimating H-DAB staining
INFO: Image data set to ImageData: Brightfield (H-DAB), 12541-16H iv
INFO: Reading data from 12541-16H iv.tif.qpdata…
INFO: Hierarchy with 423 object(s) read from C:\Users\r01mpc17\Desktop\QuPath\CD4 Connective Tissue Oral Cavity\data\12541-16H iv.tif.qpdata in 0.01 seconds

I am curious about the Image tab more than anything - depending on how the image is loaded, the required settings for cell detection might be quite different. For example, in the image you shared, the pixel size is very wrong:


I am assuming the right side is the burned in scale bar and looks a bit more appropriate, while QuPath is reading the metadata (frequent issue for uncalibrated TIFF files) for the pixel size as much too large.

I suspect one of the times you have loaded images, the metadata was very different.

2 Likes

How could the metadata have changed?
Could you please tell me how I can calibrate the TIFF files as when I create new projects to analyse TIFF files (for different markers) they are also showing the same scale bar in QuPath (100mm)?

I don’t know what was done with or to the images originally. Ideally, you should only feed QuPath the original image data file from the microscope, or follow a specific set of preprocessing steps. What you used was not the original image (there is a scale bar burned in so this is clearly not an original image); it appears you are analyzing a screenshot or snapshot of your original image with an overlay that includes a 50um bar. I am not sure what else might have happened to the image during that process!

There are commands like setPixelSizeMicrons(x,y) if you know the pixel size, but you would normally get that from the microscope, or have it saved in the metadata. Once your images are imported, you could run a pixel size script “for project.” Alternatively, the metadata for smaller files can be set in FIJI using Image->Properties…

Not all custom microscopes may have the option, but most major manufacturers have formats that include pixel size that QuPath can read, so that is your best option.

At this point, I do not know what the server settings were from 2 years ago, so someone may have run a script to set the pixel size at that point, or used a different image server that read the metadata, or something else entirely that I am not thinking of. I can’t think of any way to be sure at this point without more information about the original.

Ah, well-spotted @Research_Associate – the pixel size may well be responsible.

Is it an option to update to use the latest version (v0.2.3)?

I don’t think that existed in v0.1.2 (I don’t remember if or how the pixel size could be set back then).

1 Like

Ah, shoot, right. I think the main way back in 0.1.2 was FIJI.

1 Like