qupath / qupath

QuPath - Open-source bioimage analysis for research
https://qupath.github.io
GNU General Public License v3.0
1.05k stars 281 forks source link

Cannot see colors for the different annotations after running the classifier #210

Closed Sane430 closed 6 years ago

Sane430 commented 6 years ago

Hi,

I am trying to run the classifier the same as shown in the directions on how to do this (https://github.com/qupath/qupath/wiki/Classifying-objects). Using only 2 annotations, tumor and stroma. The classifier looks exactly like the one from your directions, I also get no error in running the classifier in the details. But I don't see any colors on my image showing up which cells were annotated to which group. Any idea how I can fix this?

Best, Sane

Svidro commented 6 years ago

If you could provide a screenshot of what you are looking at (cell detections/annotations+the classifier dialog) and a copy of the log (View->Show Log), that would help the troubleshooting a bit. Occasionally the classifier does run into errors and those show up in the log (unless that is what you meant by details).

Sane430 commented 6 years ago

Ofcourse! I see from the log now that all the objects were unclassified. So I understand why I don't see any colours. But as the structures are quiet different I would think that it should be able to come up whit a classifier right? image

Log-file: INFO: Selected style: Modena Light INFO: Performing update check... INFO: Starting QuPath with parameters: [] ERROR: Openslide: Property not available: openslide.objective-power INFO: Test reading thumbnail with openslide: passed (BufferedImage@77accd0e: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 200 height = 193 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0) INFO: Returning server: OpenSlide for L:\basic\divg\CEMM-Lexor\SannetH\1. SANNE\Project 2. IHC Validation PICCOLO and COIN\Qupath PICCOLO\R-PICCOLO-16_CDX2-88_20x.tiff INFO: Estimating H-DAB staining INFO: Image data set to ImageData: Brightfield (H-DAB), R-PICCOLO-16_CDX2-88_20x INFO: Will (re)compute TMA grid... INFO: Processing complete in 1.26 seconds INFO: Completed! INFO: qupath.imagej.detect.dearray.TMADearrayerPluginIJ {"coreDiameterMM": 0.7, "labelsHorizontal": "1-16", "labelsVertical": "A-J", "labelOrder": "Row first", "densityThreshold": 5, "boundsScale": 105} INFO: Adding Rectangle to hierarchy INFO: Requesting region for stain vector editing: INFO: 1932 nuclei detected (processing time: 3.82 seconds) INFO: Processing complete in 3.92 seconds INFO: Completed! INFO: qupath.imagej.detect.nuclei.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": 0.0, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true} INFO: 1165 nuclei detected (processing time: 3.94 seconds) INFO: Processing complete in 3.98 seconds INFO: Completed! INFO: qupath.imagej.detect.nuclei.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": 0.0, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true} INFO: Requesting region for stain vector editing: INFO: Adding Rectangle to hierarchy INFO: Requesting region for stain vector editing: INFO: 989 nuclei detected (processing time: 1.90 seconds) INFO: Processing complete in 1.92 seconds INFO: Completed! INFO: qupath.imagej.detect.nuclei.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": 0.0, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true} INFO: 2443 nuclei detected (processing time: 2.11 seconds) INFO: Processing complete in 2.15 seconds INFO: Completed! INFO: qupath.imagej.detect.nuclei.WatershedCellDetection {"detectionImageBrightfield": "Optical density sum", "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": 0.0, "includeNuclei": true, "smoothBoundaries": true, "makeMeasurements": true} INFO: 2443 nuclei detected (processing time: 3.01 seconds) INFO: Processing complete in 3.03 seconds INFO: Completed! INFO: qupath.imagej.detect.nuclei.WatershedCellDetection {"detectionImageBrightfield": "Optical density sum", "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} INFO: Smoothing using TMA cores INFO: Processing complete in 0.18 seconds INFO: Completed! INFO: qupath.lib.plugins.objects.SmoothFeaturesPlugin {"fwhmMicrons": 25.0, "smoothWithinClasses": false, "useLegacyNames": false} INFO: Measurement mapper limits for Smoothed: 25 µm: Nucleus/Cell area ratio: 0.12291267514228821, 0.4222889840602875 INFO: Adding Area (AWT) to hierarchy INFO: Adding Area (AWT) to hierarchy INFO: Adding Area (AWT) to hierarchy INFO: Adding Area (AWT) to hierarchy INFO: Adding Area (AWT) to hierarchy INFO: Adding Area (AWT) to hierarchy INFO: Adding Area (AWT) to hierarchy INFO: Stroma: 138 INFO: Tumor: 165 INFO: 303 objects available for classifier training from 1 images INFO: Cell: DAB OD max Quartile 1: 0.2062 INFO: Cell: DAB OD max Median: 0.4188 INFO: Cell: DAB OD max Quartile 3: 0.5843 INFO: Cell: DAB OD max Mean: 0.4174 INFO: Cell: DAB OD max Std.Dev.: 0.2091 INFO: Cell: DAB OD mean Quartile 1: 0.0725 INFO: Cell: DAB OD mean Median: 0.1700 INFO: Cell: DAB OD mean Quartile 3: 0.2724 INFO: Cell: DAB OD mean Mean: 0.1814 INFO: Cell: DAB OD mean Std.Dev.: 0.1103 INFO: Feature selection: Classifier set to train using all 67 available features INFO: Stroma: 138 INFO: Tumor: 165 INFO: 303 objects available for classifier training from 1 images INFO: Training size: 67x303 INFO: Responses size: 1x303 INFO: RTrees classifier termination criteria: { type: 1, maxCount: 50, epsilon: 0.0} INFO: Classifier trained with 303 samples INFO: Classifier training time: 0.04 seconds INFO: Classification time: 0.08 seconds INFO: Percentage of correctly classified objects in TRAINING set: 0.00% (n=303) WARN: It is strongly advised not to report accuracies based on testing using the training set! INFO: Number of unclassified objects in the test set: 303 (100.00%) INFO: Confusion matrix Stroma Tumor Stroma 0 0 Tumor 0 0

INFO: Number of reclassified objects: 4375 of 4375

Please let me know if you have any suggestions on how I can run the classifier succesfully.

Best, Sanne

Sane430 commented 6 years ago

Using only the smoothed featurs for the classifier I do see now that the classifier works:

INFO: Number of reclassified objects: 40 of 4375 INFO: Stroma: 138 INFO: Tumor: 165 INFO: 303 objects available for classifier training from 1 images INFO: Classifier already trained with the same samples - existing classifier will be used INFO: Classifier training time: 0.01 seconds INFO: Main classifier unchanged... INFO: Classification time: 0.00 seconds INFO: Percentage of correctly classified objects in TRAINING set: 100.00% (n=303) WARN: It is strongly advised not to report accuracies based on testing using the training set! INFO: Confusion matrix Stroma Tumor Stroma 138 0 Tumor 0 165

But still it doesn't apply this to the rest of the picture.

Sanne

petebankhead commented 6 years ago

It's a bit of a mystery to me, but I suspect the smoothed features might not be being calculated everywhere. It's best to make sure there is no object selected before running that command, and then telling QuPath to processing all TMA cores.

Some of the recent tutorial videos could also help - the second set show the process of training a classifier.

Sane430 commented 6 years ago

Hi Pete,

Thanks for the tip! After I selected only the smoothed features for training it worked!

Sanne