Cellprofiler: Adding Tracking Aberration Metric (TrAM) module

Created on 3 Apr 2017  路  10Comments  路  Source: CellProfiler/CellProfiler

We published a paper last year on a metric for detecting cell
tracking errors. The goal is to improve data quality by either correcting
or discarding poor tracks. But first you have to find them. The algorithm
basically looks for sudden jumps in multiple data values simultaneously
(e.g. cell area and intensity), which are considered to more likely originate
in tracking error than actual biology. Here is a link to the article:
http://www.nature.com/articles/srep34785

I'd like to create a module for CellProfiler to implement this functionality.
It would take the results of cell tracking, perform the computation on a
per-cell basis, and then return a table of tracking quality (one value per
cell). The metric employs statistics across multiple cells (to determine
"typical" behavior), so it is not purely a cell-by-cell algorithm.

Since this is my first time writing a CellProfiler module, if anyone can offer
assistance on how to best approach this, I'd appreciate it. For example,
is there an existing module I can start with as a template for development?

So far, I can get CellProfiler compiled and running within PyCharm...

Thanks!

Feature request

All 10 comments

Nice! I'm looking forward to digging into your paper. An initial question, though: The module TrackObjects has the option of using a linear assignment problem (LAP) approach to bridge gaps, using Kalman filtering as well as the cell area to make the call (I think). But it sounds like your approach is more agnostic w.r.t. tracking model; is that correct?

The repo has a wiki including a page on writing modules: https://github.com/CellProfiler/CellProfiler/wiki/Orientation-to-CellProfiler-code, in particular the "Module-structure and data storage retrieval" sub-page.

After looking at that, checking out the TrackObjects module itself might be helpful. I think you'd esp. want to pay attention to the post-processing section, e.g., https://github.com/CellProfiler/CellProfiler/blob/master/cellprofiler/modules/trackobjects.py#L1454. this deals with any operations that need to be performed once all image cycles have been completed (which it sound like your approach requires).

Hi, @DanRuderman!

If you鈥檙e interested, we could schedule a Skype call to outline the module writing process.

@braymp Thanks for the info! Per your gap bridging question, this method simply calls out suspect tracks (that are complete to begin with). It would be your choice to discard or fix them. As published, the algorithm basically looks for coincidental deviations from smooth measurements across time (e.g. position, cell area, shape parameters, intensity) that indicate tracking failure. It could easily be altered to provide a sorted list of the most suspect time points so that corrections could be focused on those data values (e.g. via Kalman filtering).

@0x00b1 Skype sounds great. Let me follow up on Mark's suggestions and get more educated first. I'm out of town for a bit so perhaps early next week?

@0x00b1 Let me know if you have some time to Skype this week. You can email me at [email protected] if that's easier. Thanks.

I'm having an issue accessing the data I need across all time points. Maybe I need to set up the module differently. When I am in the run() method of my module I can only see the data for time point 1 in the workspace.measurements object. measurements.get_image_numbers() returns a list with the values 1 through 9, but the data across images only have values for the first image.

Any help appreciated. Thanks.

OK - I think I understand. I was in the run() method when I really wanted post_group().

Working with the pandas package would be nice for data manipulation, but I don't see it used by any other code in CellProfiler. Should I choose a different method so as to avoid the need for an additional package?

Thanks.

The results of TrAM have multiplicity of one per tracked object label. How do I best store these measurement results? The existing object types are "Experiment", "Image", and "Nuclei" (which is my name for the identified objects). It would make sense to put these measurements under "Nuclei", except that there is a single value that covers all images under a given track label.

Do I just repeat the data across all images? I want to be sure there is a good way to mesh into a forward workflow which can filter out tracks based on TrAM value.

Thanks.

Yes, I think repeating the value for all objects sharing a given track label is the correct option (much like how the tracking label itself is repeated for a given tracked object collection)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

0x00b1 picture 0x00b1  路  5Comments

0x00b1 picture 0x00b1  路  10Comments

katrinleinweber picture katrinleinweber  路  3Comments

dlogan picture dlogan  路  9Comments

AnneCarpenter picture AnneCarpenter  路  6Comments