Image quality DisplayDataOnImage


#1

Hi,

I am trying to overlay cell numbers onto an image using the DisplayDataOnImage module and then save the image as a tif using SaveImages. My problem is that the image quality of the saved image is really poor.
When I use DisplayDataOnImage through the data tools the image quality seems to be quite bad as well, but interestingly, when I drag the image bigger with my mouse the quality seems to become better and less pixelated? Another advantage of dragging the image bigger with the mouse is that the overlayed cell numbers get smaller in relation to the image (e.g. they do not get bigger). The quality (resolution) gets even better, at least visually, when I then use the zoom feature.
Unfortunately, however, I haven’t yet figured out how to increase the image quality when I do this from within a pipeline.

Do you guys have any suggestion?
Sorry if this post is confusing, let me know if it was unclear and I will try and explain myself better.

Thank you
Robert


#2

Hi Robert,

One possible reason for this is that SaveImages works by grabbing a snapshot of the DisplayDataOnImage module window. This means that it grabs a picture of the window at the resolution it’s displayed on screen, and not the original resolution of the loaded image.

So if the original image was 1024x768 pixels to begin with, but is the window that displays the overlaid image is only 384x512 pixels on screen (half the size of the original), it will be saved at the smaller size and there is a resolution loss. The reason why it looks better when you expand it with your mouse is that you are then increasing the module window size closer to what the original image was.

I hope this answers your question. Unfortunately, other than maximizing the module window with the image (as you’ve been doing) and then saving it, CellProfiler doesn’t include this ability up front. This sound like a good feature to add for the next release.

Regards,
-Mark


#3

Hi again Robert,

The ability to specify the desired resolution in the DisplayDataOnImage module has been added as a new feature. It will be available in the next release of CellProfiler, which will be a few weeks from now.

Regards,
-Mark


#4

So, where is the ability to specify the desired resolution in the DisplayDataOnImage module? I could not find it. Thanks!