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
Error in Measurement with StarDist script with RGB fluorescence images #686
Comments
I can replicate the problem with the measurements. Basically, RGB images are a special case. QuPath + StarDist should measure them properly if they are brightfield (after color deconvolution), but if a fluorescence image is RGB then it just uses the packed RGB value as a single channel - rather than splitting out the red, green and blue components. This is a bug that we can fix. I don't see a problem with the cell expansion, but note that
In the short term, you can open your images in ImageJ/Fiji and run Image → Color → Make Composite. While you're there, you can call Analyze → Set Scale... with a line drawn over the scalebar and input the true length to fix the pixel size. I've attached an example of the image after conversion; this should work in QuPath properly. Finally, my guess is that your RGB image isn't the raw data - since it has a scalebar burned in to it. So the pixel values might be changed and analysis might not make sense anyway. I've written a bit about this topic in my image analysis handbook, e.g. here (and some other chapters about RGB conversion). |
Thanks for the quick response. Converting to composite works. Is it an option to let QuPath do this automatically when the image type is set to Fluorescence? And for the standard "Cell Detection" the RGB Data was not a problem. |
I'm afraid not, QuPath doesn't really allow you to modify the image in any way, so changes like this are difficult. Batch conversion in ImageJ is the easiest 'fix' I can think of. The code used to make measurements with StarDist is a lot more generic than the code for the built-in cell detection... but I overlooked the RGB problem since I didn't have any images quite like that. Good to know about it now so we can fix it before the next release.
I'm glad! If you haven't already, it would be great if you could fill in the user survey - and please share it with anyone else you know uses the software! |
I filled in the Survey a few days a ago already. I will ask my colleagues to do this also. |
Great, thanks! |
See qupath#686 This fix should only impact StarDist intensity measurements for RGB images (or any scripts using ObjectMeasurements directly).
See qupath#686 This fix should only impact StarDist intensity measurements for RGB images (or any scripts using ObjectMeasurements directly).
Closing now, since the fix is now merged and will be in v0.3.0. |
Bug report
Describe the bug
I compiled QuPath with Stardist as described in the docs. The detection of nuclei on the blue channel works fine (although the cell expansion value is ignored). The Measurements are however not correct! I get only values for the red channel of a RGB image (see attachment) and they are incorrect (negative values, see screenshot). There are no values for the green channel.
To Reproduce
The script (I have it in a subfolder of the QuPath executable 'ScriptStardist', it finds the model then automatically.
ScriptStardist.zip
The image (ImageJ Tiff file)
CTRL-01.zip
Expected behavior
Measurements like the 'Cell Detection' command.
Screenshots
Screenshot of the negative values.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: