Untangle worms training error

I am trying to create my own training set to recognize and untangle worms (using the pipeline from the wormtoolbox). I get lovely identification of objects in the ‘identifyprimaryobjects’ module. However, untangleworms does not recognize all those objects as worms. To fix this I decided to create my own training set. It seemed to work well, but when I try to use it in my untangle worms pipeline, I get this error:

Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 309, in run
File “cellprofiler\modules\untangleworms.pyc”, line 489, in run
File “cellprofiler\modules\untangleworms.pyc”, line 729, in run_untangle
File “cellprofiler\modules\untangleworms.pyc”, line 2052, in worm_descriptor_building
File “cellprofiler\modules\untangleworms.pyc”, line 2115, in rebuild_worm_from_control_points_approx
ValueError: cannot convert float NaN to integer

What am I doing wrong? Thank you!

Hi Rachel,

We actually just became aware of this bug ourselves. We’ve fixed it and are going to release a new version with the fix. It’s caused by worm “objects” that are only one pixel. What you can do for now is add a “MeasureObjectSizeShape” module after identifying the touching worms and then a “FilterByObjectMeasurement” model and exclude worm objects that are less than two pixels. Let me know if this solves it for you!


Hi Kate,

I added the modules you suggested and I am still getting the same error.

Also, the training has a lot of trouble when the ends of the worms are touching. Is there any way to tell it how long the worms can be since they are all relatively the same size?

Thank you,