Problem opening images from properties file



I’ve been using CP and CPA for quite some time now on a Mac machine and I used to be able, in CPA, to open the images corresponding to a defined well in my 96 wells plate or to a point in a scatter plot generated with CPA or to work with the classifier function.
Now recently I discovered the advantages of Ilastik and that greatly facilitated my life in identifying objects within a cell. The problem is that now I have to work on a PC because Ilastik does not talk to CP on a Mac. No big deal, I used VirtualBox to install a virtual machine running Windows 7 on my Mac and everything is ok…or so I thought…
The problem is that now CPA opens the properties file without a problem, generates plate views, charts and so on BUT whenever I try to open images from CPA I get the following message:

An error occurred in the program:
ValueError: not a valid TIFF file

Traceback (most recent call last):
File “platemappanel.pyc”, line 470, in handler
File “imagetools.pyc”, line 61, in ShowImage
File “imagetools.pyc”, line 52, in FetchImage
File “imagereader.pyc”, line 31, in ReadImages
File “imagereader.pyc”, line 112, in read_images_old_way
File “imagereader.pyc”, line 189, in ReadBitmap
File “imagereader.pyc”, line 307, in ReadBitmapViaTIFFfile
File “tifffile.pyc”, line 143, in init
File “tifffile.pyc”, line 162, in _fromfile

Any idea?
I have attached the project I’m using to analyze my images

Thank you very much in advance

Ilastik test local save.cpproj (205 KB)


Hi Matteo,

Are you running CPA from source or from a compiled binary (like our version 1170 release)?
Do you have CellProfiler installed too on the VirtualBox? CPA-from-source, at least, uses some aspects of CP so if CP is not installed and pointed to properly in your PYTHONPATH, then certain aspects like the BioFormats reader won’t work.

As a shortcut solution, you could try our trunk build here which may solve the tiffreader issue. Be patient for the webpage.

And glad your VirtualBox solution works (at least partially, so far)!



Hi David,
Thanks for your reply…which I’m afraid I understand only in part! :wink:
To give you a tentative answer, I’m using CPA 2.0 (r11710) which I downloaded from the CP webpage and yes, both CP and CPA are installed and running on the VrtualBox machine.
If it may help, all images and resulting analysis are stored on a server (so not locally) in our institute and both Mac and VirtualBox have access to it. It worked perfectly from my Mac before but perhaps there’s a problem with CPA/VirtualBox/Server? It looks like CP from VirtualBox access the raw images without a problem and stores the results also without a problem so I guess that’s fine…

I tried to access the trunkbuild you suggested but the link to the trunkbuilds for CPA at the bottom of the page gives me an error (looks like I’m doomed with error messages…):

OSError Python 2.4.2: /usr/bin/python
Mon Jun 29 06:48:08 2015

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.



31 best_mac_dir, best_mac_file = find_latest(MAC_DIR, “.dmg”)

32 best_win32_dir, best_win32_file = find_latest(WIN32_DIR, “.exe”)


best_mac_dir undefined, best_mac_file undefined, find_latest = , MAC_DIR = ‘/imaging/analysis/CruiseControl/artifacts/CPAnalyst’

/web/wwwprod/sites/ in find_latest(directory=’/imaging/analysis/CruiseControl/artifacts/CPAnalyst’, extension=’.dmg’)
12 def find_latest(directory, extension):

13 latest = 0

14 for subd in os.listdir(directory):

15 try:

16 myself = int(subd)

subd undefined, global os = <module ‘os’ from ‘/usr/lib64/python2.4/os.pyc’>, os.listdir = , directory = ‘/imaging/analysis/CruiseControl/artifacts/CPAnalyst’

OSError: [Errno 2] No such file or directory: '/imaging/analysis/CruiseControl/artifacts/CPAnalyst’
args = (2, ‘No such file or directory’)
errno = 2
filename = '/imaging/analysis/CruiseControl/artifacts/CPAnalyst’
strerror = ‘No such file or directory’


Oh, the errors related to

... filename = '/imaging/analysis/CruiseControl/artifacts/CPAnalyst' strerror = 'No such file or directory'
are not your fault, but our internal network here at the Broad. We and IT are working on it - try again later today.


#5 should be working now (though it takes a minute to refresh).


Thanks, it worked now.
However, I installed the version r20140401184343 (hope I got all the numbers right) and still have the same problem when trying to open images from CPA:

An error occurred in the program:
ValueError: not a valid TIFF file

Traceback (most recent call last):
File “platemappanel.pyc”, line 470, in handler
File “imagetools.pyc”, line 61, in ShowImage
File “imagetools.pyc”, line 52, in FetchImage
File “imagereader.pyc”, line 38, in ReadImages
File “imagereader.pyc”, line 140, in read_images_old_way
File “imagereader.pyc”, line 217, in ReadBitmap
File “imagereader.pyc”, line 335, in ReadBitmapViaTIFFfile
File “tifffile.pyc”, line 143, in init
File “tifffile.pyc”, line 162, in _fromfile


any suggestion on how to solve this issue?


Hello, me again.
I have found a workaround for the “TIFF issue”: basically I exported the raw images of the 96 wells plate into TIFFS and used these in CP. The analysis looks good AND now I can open corresponding images in CPA either by selecting images from a defined well or using the classifier function. So far, so good…

There is still something I’m struggling with: in the Export to Database module I have checked the option to “save thumbnails directly in the database” so that I can do without all the Overlay Outlines and Save Images modules that you can see in the CP project I sent in my first post (at least I think this is the overall sense of writing thumbnails in the Database directly…). Now, in CPA, if I click on a well in the PlateViewer module I can see the “show thumbnail montage” option, however if I click on it I have…yet another error message that goes like this:

An error occurred in the program:
IndexError: list index out of range

Traceback (most recent call last):
File “platemappanel.pyc”, line 465, in
File “platemappanel.pyc”, line 496, in show_thumbnail_montage
File “imagetools.pyc”, line 121, in MergeToBitmap
File “imagetools.pyc”, line 165, in MergeChannels

Am I doing something wrong? is there another way to access the thumbnails I saved in the Database?

Thanks again



Hi Matteo,

If you are still having issues, would you mind posting your properties file here?
BUT please note that the thumbnails do not replace the functionality of the raw images or saved outlines, but rather just add to the functionality. To do classification, e.g. you will need the full, raw images at the very least, and possibly need the saved outlines.



Hi David,

I think I got to the same conclusion yesterday so I opted back for the Overlay/Save option in my pipeline. I found that if I save the images on the local disk and then transfer them later on our server I save lots of time for the analysis…

Looks like I can’t upload the properties file: “The extension properties is not allowed”

Never mind I think I’ll go back to my original setup (unless you still want to see the properties file to correct any possible bug in the software…)

Thanks anyway!



Sounds good. If you zip your properties file, it will upload. I’m happy to take a look since others have noted this error too, though I suspect it is a configuration issue or maybe a non-grayscale image that is causing it.



Here you go!

Matteo (2.73 KB)


Hi Matteo,

So my current thought (unproven!) is that the entry ‘image_thumbnail_cols’ can only take grayscale images. Are any of your Outlines images here color?

It may be that the “MergeChannels” request is assuming multiple grayscale images, rather than multiple color images (or some combination). I am pretty sure that was our assumption when coding this, but obviously was not the only input type. I haven’t tested or dug through the code in any depth though.

If so, and you want to test this – can you try making them grayscale, perhaps by changing the colors in OverlayOutlines and/or SaveImages white, or using a grayscale colormap?



Hi David,

Thanks for the input! Indeed I have all my outlines as green lines in the OverlayOutlines module 'cause it’s easier to see them once I overlay them onto grayscale images.
I can definitely give it a try and set them to greyscale to see what happens!

I’ll do that and let you know!




…unfortunately that was not the issue…
I got the same error message



OK thanks for testing. It may be that there is a (non-explicit) limit on the number of channels for the outlines. I would
(1) Ensure that the number of entries in “image_channel_colors” matches the number of entries in “image_thumbnail_cols”
(2) If the above doesn’t help, then try sequentially reducing the number of entries in the above settings (and restarting CPA) and see if there is a practical limit.

Sorry for the empirical nature of this, but we a re a little short staffed on software engineers (though we are in the process of hiring another soon, whew).




I’ll give it a try once again and let you know, happy to help if it’s a problem that other users are encountering!

I’ve just launched an analysis on quite a number of 96 well plates so I will be able to test only when it’s finished…




Hi Matteo,

Did you ever figure this out?



has any body find solution yet ??


Unfortunately not…I did test the solution suggested but did not work


Matteo Bonazzi, PhD
Cell Biology of Bacterial Infections
1919 Route de Mende
34293 Montpellier
Tel : 33 (0) 434359459
Fax : 33 (0) 434359414