Problem with loading images

Hi,

I just recently started to use cellprofiler and I have a (newbie) problem. I set up a quite simple pipiline to test out, how CP works. It is supposed to calculate ratios between detected ROIs. CP is aable to load the test images (when double-clicking on it), but during a test run, the LoadImages modules produces the following error message:

Traceback (most recent call last):
File “cellprofiler\gui\pipelinecontroller.pyc”, line 845, in on_debug_toggle
File “cellprofiler\gui\pipelinecontroller.pyc”, line 850, in on_debug_start
File “cellprofiler\gui\pipelinecontroller.pyc”, line 868, in start_debugging
File “cellprofiler\pipeline.pyc”, line 1321, in get_groupings
File “cellprofiler\modules\loadimages.pyc”, line 2277, in get_groupings
KeyError: 'Ex340’
Traceback (most recent call last):
File “cellprofiler\gui\pipelinecontroller.pyc”, line 921, in do_step
AttributeError: PipelineController instance has no attribute ‘_PipelineController__within_group_index’

and I have no clue, what my mistake could be …

Thnakd for your help,

Sebi

Would you be able to upload the offending image and pipeline, so we could take a look?
-Mark

Hi,

I attached the pipeline and had a quick look at it. What looks strange too me, are some lines


Number of images in each group?:3

Name this loaded image:Ex340
Name this loaded object:Nuclei

since inside the GUI I did no specufy something like images in each group = 3 or Name objects = Nuclei. But I must admit, I am a newbe, so this might be normal.

The directory just contains to image sequences (timelapse, 21 frames). One sequence are cells excited with 340nm, the other one exited with 380nm. and finally I want to detect all the cells and calulate the Ration for the detected ROIs. I also attached the two image sequences, just in case.

Thanks for your help.

Sebi




Pipe340_380.cp (8.5 KB)

Hi Sebi,

Investigating this pipeline has uncovered a couple of possible bugs. We will repost here when we sort it out.

Regards,
-Mark

Hi,

thanks a lot.

Sebi

Hi Sebi,

We have corrected this issue; as it runs out, it was a problem in LoadImages, as we’d never tried loading pairs of multiframe .TIF images before. The fix will be included in the next release, but if you’re daring, you can try it out with our latest public build from source code here. The trunk build is not as heavily vetted as our releases, so you should take that into account; please note the caveats mentioned on the page linked.

We also uncovered another problem with this pipeline. In CalculateMath, you’re dividing by the parent object number of a cell; this value is zero if a cell has no parent. If that happens, the code checks for a “divide by zero” and errors at that point. I’m not certain what you’re trying to do here (find a percentage of some kind), but you will want to change the measurements that are input into this module.

Regards,
-Mark

Hi Mark,

thanks for the answer. Regarding the opher problem with the pipeline, I bet this is a mistake made by me since I am a cellprofiler newbie. What I want to do is:

  • detect the cells in both channels
  • convert the cells into ROIs
  • calculate the ratio of the mean values for all ratios and all frames

Cheers,

Sebi

Hi Sebi,

In this case, you probably want to do the following:

  • Add the two images together using ImageMath (you’ll probably want to multiply each image by 0.5 in the same module) and use that as input into IdentifyPrimaryObjects. The reason for this is that you don’t want to assume that the same objects are detected in the two IdentifyPrimaryObjects modules; in fact, for frame 9, different objects are detected and the ratio you want won’t work. Rather, by adding the frames, you have a better chance of obtaining the proper objects; it is this single set of objects that you want to take measurements from.

  • At this point, you can then measure the intensity from both images using the one set of objects using one MeasureObjectIntensity module. As an aside, you don’t need the MaskObjects module; MeasureObjectIntensity will measure the intensity from the input image, restricting the ROI to the objects automatically.

  • Then, in CalculateMath, you can specify Divide
    as the operation and Cells > Intensity > MeanIntensity > Ex340 for one operand, and Cells > Intensity > MeanIntensity > Ex380 for the other.

Regards,
-Mark