Illumination Correction Patterns fail to open on CP-Analyst



Greetings to all;

Using CPA v2.2.1 I’m trying to open experiment data stored on a MySQL server. All goes well, but images are just gray squares.

The data was generated from a rather complex pipeline with 5 channels and 5 corresponding .mat illumination correction files. The raw image paths are Windows UNC paths to the image drive but the illumination correction patterns (the .mat files) are accessed via a web-server URL. This setup worked fine in the CellProfiler pipeline but causes issues in CPA. I receive an IOError-stating that the .mat file ‘does not exist’

An error occurred in the program:

IOError: [Errno 2] The file, “http://jenkins:8080/job/FILE_UPLOAD/51/artifact/VB00045742_IllumAGP.mat”, does not exist.: ‘http://jenkins:8080/job/FILE_UPLOAD/51/artifact/VB00045742_IllumAGP.mat

Traceback (most recent call last):
File “cpa\imagetile.pyc”, line 177, in OnDClick
File “cpa\imagetools.pyc”, line 69, in ShowImage
File “cpa\imagetools.pyc”, line 60, in FetchImage
File “cpa\imagereader.pyc”, line 24, in ReadImages
File “cpa\imagereader.pyc”, line 99, in read_images_via_bioformats
File “cpa\imagereader.pyc”, line 44, in _read_image_via_bioformats
File “bioformats\formatreader.pyc”, line 948, in load_using_bioformats
File “bioformats\formatreader.pyc”, line 618, in init

Now, looking at the documentation page of CPA I do not see support for .mat files despite the long list of other image formats. I suspect that this is issue is due to non-supported .mat format, but could also be the mixed use of UNC and URLs for the image paths. What do you think?

Thanks for any feedback.
Best regards

CPA Image Gallery only shows Coloured Squares

Wow, my best guess is that .mat files are indeed not supported, though it’s a shame the error isn’t more obvious if that is the case.

Can you explain why you want to look at .mat files in CellProfiler Analyst anyway?


The truth of the matter is that I don’t care about these images. They are just part of the image set in the original pipeline. They end up with the images table and CPA keeps trying to open them… And fails

Thanks and have a nice weekend!


It’s possible someone who knows more about this can point to somewhere in the properties file or in the CP pipeline configuration that would prevent those images from even showing up.

Can you clarify whether this happens when you explicitly request to look at those images? Or is it something like Image Gallery just fails upon opening because those files exist?


Well, the image gallery opens and when I ‘fetch’ the images it just displays gray square thumbnails. The console displays no errors at that point. When I then ‘double-click’ on one of the images I get the pop-up dialog with the IOError message “.mat does not exist”

It would be great if I can just fix this by editing the properties file.


If you open your properties file you should see a list of channels that CPA is attempting to display for each image, and it looks like your illumination correction channels are in them (based on the fact that they’re visible in the top menu bar of your image gallery). If you edit the “Image Path and File Name Columns” section of the properties file to look like this, I think it should work (choice of which color to assign to each channel obviously at users’s discretion)

image_path_cols = Image_PathName_OrigDNA,Image_PathName_OrigER,Image_PathName_OrigRNA,Image_PathName_OrigAGP,Image_PathName_OrigMito
image_file_cols = Image_FileName_OrigDNA,Image_FileName_OrigER,Image_FileName_OrigRNA,Image_FileName_OrigAGP,Image_FileName_OrigMito

# CPA will now read image thumbnails directly from the database, if chosen in ExportToDatabase.
image_thumbnail_cols = 

# Give short names for each of the channels (respectively)...
image_names = DNA,ER,RNA,AGP,Mito

# Specify a default color for each of the channels (respectively)
# Valid colors are: [red, green, blue, magenta, cyan, yellow, gray, none]
image_channel_colors = red,green,blue,yellow,magenta


Excellent! Editing the properties file as you’ve suggested works great!
I can now retrieve the images and outlines.

I’m thinking that the way to avoid manually editing the properties file is by setting the images to include in the CP ExportToDatabase module one by one and do not include the Illumination Correction ones. What do you think?

Thanks and best regards


I think that should work exactly as you just outlined.