CPA UI misbehaving

I am trying to install the 2.0 chain CellProfiler/CPA on an additional ( ! ) Linux machine (Ubuntu 11.04).
CellProfiler itself is working great, and even CPA, after some tweaking of the properties file, start “nicely”.
Unfortunately, when we try to drag a cell image in a bin (positive or negative), it just go back up (basically the drag-and-drop does not work…).
I am wondering if anybody had such an issue. Could it be an authorization issue or a missing module?
Thanks a lot,
Indro Fedrigo
UC Berkeley

What version of wx are you running? We’re currently seeing this problem in our Mac OS X 64-bit environment and I believe it’s because of something that has changed in 2.9.x. If you’re using 2.9.x, try uninstalling and installing 2.8.11 or 2.8.12 and let me know if this fixes it.


Hi Adam,
I am using 2.8.11…
From my limited debug, it seems that in, around :

def OnMotion(self, evt):
if not evt.LeftIsDown() or not self.leftPressed:
# Removed for Linux compatibility
#cursorImg = self.bitmap.ConvertToImage()
#cursorImg.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, int(self.bitmap.Size[0])/2)
#cursorImg.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, int(self.bitmap.Size[1])/2)
#cursor = wx.CursorFromImage(cursorImg)

    # wx crashes unless the data object is assigned to a variable.
    data_object = wx.CustomDataObject("ObjectKey")
    data_object.SetData(cPickle.dumps( (self.bin.GetId(), self.bin.SelectedKeys()) ))
    source = wx.DropSource(self)#, copy=cursor, move=cursor)
    **result = source.DoDragDrop(wx.Drag_DefaultMove)**
    if result is wx.DragMove:

result is 0.
The ominous message :
wx.DropSource Found at: module_not_in_the_pythonpath
maybe a clue…

Thanks for this helpful feedback. I’ve got another bug I’m about to fix, but I’ll get to this as soon as I get a chance. It’s surprising to me that you’re seeing it in 2.8.11, but I’ll see what I can do.

Hi Indro,

Unfortunately I haven’t been able to figure out what is causing the problem you’re experiencing, and unfortunately I have a number of other issues that I need to address before I can get around to this. I’ve filed a ticket so it isn’t forgotten entirely, but I can’t promise it’ll be done in any timeframe at the moment.

I tried searching for “module_not_in_the_pythonpath” since I’ve never seen this before but nothing really jumped out at me. It also appears that the problems that I’m seeing in wx 2.9.1 on OS X are actually bugs in that release as opposed to bugs in our code, so we’re kind-of stuck on that front as well for the time being.

One more thing, the result of 0 is actually the wx.Id of wx.DragCopyOnly. The place to look, if you’re interested in debugging this yourself is the SortBinDropTarget class (especially the OnData method), the call to self.SetDropTarget(SortBinDropTarget(self)) from SortBin.init, and SortBin.ReceiveDrop… there must be a reason for why the sortbin isn’t receiving the drop. Also note that the ImageTile objects themselves are also drop targets.)

Anyway, that’s all the help I have for now. I’ll let you know if I have any luck at a later point.


Alright, so I just tried Classifier on our linux server here and the DnD worked fine, so now I really don’t know if I can help. :\

Hi Adam,
Thanks for trying to figure this problem out. I did further tests with different versions of wxPython and even SWIG ( I suspect the problem may be actually there), but with no much luck, just different (wrong) behavior.
Just one quick question, if you do not mind. On what distribution/version of Linux did you try CPA 2.0 ?

Sure, it looks to be CentOS release 5.5 (Final)

Hi Adam,
I have been finally able to make some progress, and using Ubuntu 9.04, as suggested, CPA2.0 is working (with a minor bug when you try to delete a cell from a bin, but at least I can DnD them…).
There is now a problem trying to export to Database (either Mysql or Sqlite) one of the .mat files created by the new CellProfiler2.0.
We are getting this “cryptic” message:

Traceback (most recent call last):

  • File “/home/rape-lab/usr/cp2/CellProfiler/cellprofiler/gui/”, line 202, in on_run
    File “/home/rape-lab/usr/cp2/CellProfiler/cellprofiler/modules/”, line 1229, in run_as_data_tool
    File “/home/rape-lab/usr/cp2/CellProfiler/cellprofiler/modules/”, line 1280, in run
    File “/home/rape-lab/usr/cp2/CellProfiler/cellprofiler/modules/”, line 1902, in write_data_to_db
    for agg in agg_columns]
    KeyError: ‘Mean_Nuclei_AreaShape_MaxFeretDiameter*’

Any idea where it could be coming from?
(I do not see any field like that either in the .mat files or the database tables…).
Unfortunately it seems that there are no more .SQL files generated to check the query.
Thanks for your help,


I know that the FeretDiameter is a recently added measurement. It looks like the error is occurring while ExportToDatabase is computing per-image aggregate measurements. A cheap fix might be to uncheck the box or boxes or whatever that ask if you want to output aggregate measurements on a per-image basis. This question should really be moved to the CP Help forum, the people who monitor it will be able to answer this much more easily than I.

Thanks Adam,
Everything works fine now. I guess I should have been using the same version of CellProfiler for the analysis AND to ExportToDatabase… :frowning:

Ah, I though of that as a possibility but didn’t suggest it since I thought it was unlikely that you had updated other files and not exporttodatabas