Tracking Objects

cellprofiler

#1

Hi all, I’m new to CellProfiler, but it looks like an extremely powerful tool! One of our projects involves tracking labled migrating cells.

I have been successful in identifying the cells as objects across my time-lapse movies. However, I have run into problems using the “TrackObject” module. It appears that the objects have been assigned ID numbers correctly, and the program is able to follow those numbers through time. HOwever, at the end of the run, when CellProfiler attempts to export the data to excel, I recieve this error:

This error pops up everytime. I can obtain the X and Y coordinants for the center of each cell for each movie without using track objects, but then I would lose the ID information. I realize that “TrackOBject” is still in the beta version, has anyone else had this problem, or can you offer any suggestions?

Thanks!
Mark


#2

Hi Mark,

There are a couple of pieces of information that might be useful in diagnosing the problem. Could you tell us what version of CellProfiler you are using?

Also, the error message you describe often has additional information, like the files and paths where the failure occurred, plus the line number (usually in parenthesis next to the file name). Would you be able to provide that information as well?

Regards,
-Mark


#3

Mark, I’m running 1.0.5811. Thanks for your quick reply.
Let me send along some more information, since it’s quite likely I’m missing something obvious! :laughing:

My pipeline:
LoadImages
IdentifyPrimAutomatic
TrackObjects
ExportToExcel

Here is the full text from the original error. Export status gets to “Computing Means” and freezes. It occurs when I try to export “Images”

[quote]There was a problem running the image analysis. Sorry, it is unclear what the problem is. It would be wise to close the entire CellProfiler program in case something strange has happened to the settings. The output file may be unreliable as well. Matlab says the error is: Undefined function or method ‘isnan’ for input arguments of type ‘cell’. in the ExportToExcel module, which is module #04 in the pipeline.

Stack:
CPnanmean in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CPsubfunctions\CPnanmean.m (30)
CPwritemeasurements in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CPsubfunctions\CPwritemeasurements.m (82)
ExportToExcel in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\Modules\ExportToExcel.m (123)
AnalyzeImagesButton_Callback in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (10424)
gui_mainfcn in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (12164)
CellProfiler in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (57)[/quote]

Here is a new error that I recieved when I tried to export “Cells” only:

[quote]There was a problem running the analysis module ExportToExcel which is number 04. Error using ==> fprintf
Function is not defined for ‘cell’ inputs.

Stack:
CPwritemeasurements in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CPsubfunctions\CPwritemeasurements.m (261)
ExportToExcel in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\Modules\ExportToExcel.m (123)
AnalyzeImagesButton_Callback in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (10424)
gui_mainfcn in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (12164)
CellProfiler in C:\Documents and Settings\Mark\Desktop\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (57)[/quote]


#4

Hi Mark,

No, you’re no missing anything obvious. It’s a bug on our part. The identification labels for tracking, unlike other Measurements, were being written out as characters instead of numbers. The exporting function did not account for this, and failed as a result.

Fortunately the fix for this is straightforward. However, it would only be useful to you if are using the Developers version of CellProfiler 5811; the compiled version cannot accept edits without recompiling the whole package. However, if you are using the Developers version, I can forward you the edits that would need to be made. Let me know.

Regards,
-Mark


#5

Sounds good. I’m mainly using the compiled version, but we do have the Developers version running in the lab as well. I’d love to give it a try. Please forward along the edits to me when you get a chance. Thanks! I’ll let you know how it works on our system.

Mark


#6

Hi Mark,

In TrackObjects.m under the Modules directory, there are two lines (around line 270):

[quote]handles = CPaddmeasurements(handles, ObjectName, ‘TrackObjects_ObjectID’, …
CStringObjectID);
handles = CPaddmeasurements(handles, ObjectName, ‘TrackObjects_ProgenyID’, …
CStringProgenyID);[/quote]

Change this to:

[quote]handles = CPaddmeasurements(handles, ObjectName, ‘TrackObjects_ObjectID’, …
str2double(CStringObjectID));
handles = CPaddmeasurements(handles, ObjectName, ‘TrackObjects_ProgenyID’, …
str2double(CStringProgenyID));[/quote]

That should get it working. Let us know if it doesn’t or something else comes up.
-Mark


#7

Mark,

Thanks for your help. I have changed the code as you suggested. It is still having a problem exporting to excel:

[quote]There was a problem running the analysis module ExportToExcel which is number 04.
Improper arguments for waitbar

Stack:
waitbar in C:\Program Files\MATLAB\R2008b\toolbox\matlab\uitools\waitbar.m (249)
CPwaitbar in C:\Program Files\CellProfiler_5811Bugfix\CPsubfunctions\CPwaitbar.m (9)
CPwritemeasurements in C:\Program Files\CellProfiler_5811Bugfix\CPsubfunctions\CPwritemeasurements.m (27)
ExportToExcel in C:\Program Files\CellProfiler_5811Bugfix\Modules\ExportToExcel.m (123)
AnalyzeImagesButton_Callback in C:\Program Files\CellProfiler_5811Bugfix\CellProfiler.m (4316)
gui_mainfcn in C:\Program Files\CellProfiler_5811Bugfix\CellProfiler.m (6073)
CellProfiler in C:\Program Files\CellProfiler_5811Bugfix\CellProfiler.m (55)[/quote]


#8

Hi Mark,

This is a problem that has just cropped up with MATLAB R2008b, in which Mathworks changed the waitbar handling and caused it to break in CP. Have a look at this thread for details on how to fix it.

Regards,
-Mark


#9

Aha! that explains my “Load Pipeline” problems as well. Thanks! :smile: The cell tracking program now works, it will follow the identified cells over the course of the movie. It looks like the output files have not been optimized for time-lapse, with such things as speed/cell/frame, avg speed/cell/movie, length of time between cell divisions, etc. Let me know if I’m missing something there…otherwise we can get to work on that on adding the output parameters that we will need.


#10

Hi Mark,

Glad to hear that it’s working. I’m actually in the process of updating the code since it’s still in an unfinished form (as you know). If you make improvements or add features that you think other CP users might appreciate and would like to share, please feel free to post them here!

Regards,
-Mark


#11

Hi,

I’m having the same (or similar) problem as described below with the following version of CellProfiler: CompiledCellProfilerXP325811Bugfix.

I can’t export to excel.

I haven’t tried the Developer’s version yet, because I don’t have matlab on my computer (I’m working on it). Is there any way that I can get a corrected Module?

I have attached a sample PIPELINE and a couple of images.

Thanks,

Jan

Error message:

There was a problem running the image analysis. Sorry, it is unclear what the problem is. It would be wise to close the entire CellProfiler program in case something strange has happened to the settings. The output file may be unreliable as well. Matlab says the error is: Undefined function or method ‘isnan’ for input arguments of type ‘cell’. in the ExportToExcel module, which is module #14 in the pipeline.

Stack:
CPnanmean in C:\Program Files\CellProfiler\CompiledCellProfilerXP325811Bugfix\CompiledCellProfiler\CellProfiler_mcr\CPsubfunctions\CPnanmean.m (30)
CPwritemeasurements in C:\Program Files\CellProfiler\CompiledCellProfilerXP325811Bugfix\CompiledCellProfiler\CellProfiler_mcr\CPsubfunctions\CPwritemeasurements.m (82)
ExportToExcel in C:\Program Files\CellProfiler\CompiledCellProfilerXP325811Bugfix\CompiledCellProfiler\CellProfiler_mcr\Modules\ExportToExcel.m (123)
AnalyzeImagesButton_Callback in C:\Program Files\CellProfiler\CompiledCellProfilerXP325811Bugfix\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (10442)
gui_mainfcn in C:\Program Files\CellProfiler\CompiledCellProfilerXP325811Bugfix\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (12182)
CellProfiler in C:\Program Files\CellProfiler\CompiledCellProfilerXP325811Bugfix\CompiledCellProfiler\CellProfiler_mcr\CellProfiler\CellProfiler.m (57)
Count_and_TrackPIPE_Gray_image.mat (1.29 KB)