How to save data and keep them for every cycle?

Hi, team
sorry, this my frist time to set pipeline so… thanks for your help!
my images were download from “Example Pipelines and Images” in cellprofiler’s web. three chanel(blue/pink/green)
my basic pipeline are:
loadimages
identifyPrimAutomatic(for blue)
identifyPrimAutomatic(for pink)
identifyPrimAutomatic(for green)
identifysecondary(for blue and pink)
identifysecondary(for blue and green)
MeasureObjectAreaShape(for B/P/G area)
MeasureObjectintensity(for red)
MeasureObjectintensity(for green)
ExportToExcel
my Question: 1. how to set modul to identify Green objects which have red object’s area?
2. after many cycle, why just the last one’s excel data in output file?

Some questions:

[quote=“LWY”]

  1. how to set modul to identify Green objects which have red object’s area?[/quote]

By this, do you mean (1) red objects with an area measurement equal to that of a green object, or (2) red objects which overlap a green object?

By this, do you mean that (1) you see the message box saying that the Excel file is being written only on the last cycle, or (2) that when you open the Excel file, the only measurements you see are for the last image set (i.e., cycle) processed?

Regards,
-Mark

Mark,
We seem to be having the same problem ourselves. We have a pipeline where we identify primary and secondary objects, apply a mask, and then extract granularity/size/intensity information from the masked area. Finally, we try to output the results to a series of Excel files that would correspond to the individual sets of images (same fields of view with 3-channels of color).

We’ve found that the ExportToExcel appends each data set to a single data file.

To break up the data for each set into separate files we tried selecting “Yes” for the option to create subdirectories that match the image directory’s structure. However, it throws up an error when it’s time to save. The pipeline actually completes all of the analysis properly, but when it comes time to actually export the results to the files it says:

“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: Reference to non-existent field ‘Current’. in the ExportToExcel module, which is module #06 in the pipeline.

I tried looking at the MatLab code for the module, but couldn’t figure out what to change to make this work.

As of now, I’m trying to figure out a way to parse the single, large Excel file into separate files since I don’t know if CP can do it.

Please help! Thanks.

-Kazem

Hi Kazem,
Just to clarify: Are you using the developer’s version or the compiled version of CellProfiler? In other words, do you need to fully licensed version of MATLAB to run it?

Regards,
-Mark

Mark,
Thanks for the reply. I’m using the compiled version of CP, however we do have a fully licensed version of MatLab. I downloaded the developer’s version of CP earlier and was looking through the code of the ExportToExcel module. Instead of altering the module itself, I wrote a new function that takes its output and splits it up into individual datasets. But having the module do it automatically would be great!

-Kazem

Would you be able to upload an output file (i.e, DefaultOUT.mat) to the forum, if it’s not too big? That way, I can diagnose the problem with your pipeline and the measurements to be written out.

Regards,
-Mark

[quote=“mbray”]Would you be able to upload an output file (i.e, DefaultOUT.mat) to the forum, if it’s not too big? That way, I can diagnose the problem with your pipeline and the measurements to be written out.
[/quote]

I downloaded the Fruit Fly Cells example (cellprofiler.org/linked_file … Images.zip) and used the images included there.

Let me know if you need more information! Thanks.

-Kazem
DefaultOUT.mat (271 KB)

Hi Kazem,

I believe I found the problem. Beneath the following line in ExportToExcel (around line 188)

add the following line:

This should fix the bug.

Regards,
-Mark

Mark,
I’m pretty sure that resolved the issue. I’m not 100% sure that it’s recreating the same directory structure as the images, but we’ll find out soon enough with more complicated pipelines, I’m sure. But it’s working like a charm for now.

Thank you!

-Kazem

[quote=“mbray”]Some questions:

[quote=“LWY”]

  1. how to set modul to identify Green objects which have red object’s area?[/quote]

By this, do you mean (1) red objects with an area measurement equal to that of a green object, or (2) red objects which overlap a green object?

By this, do you mean that (1) you see the message box saying that the Excel file is being written only on the last cycle, or (2) that when you open the Excel file, the only measurements you see are for the last image set (i.e., cycle) processed?

Regards,
-Mark[/quote]

Mark,
thanks for your help! my answer for your questions are (1) and (2)

LWY

For the first question, can you explain more about what sort of results you are looking for? For example, you want to find red and green objects with equal area, but there is not a module which does this directly; you would have to analyze the measurements that are output in your spreadsheet separately. However, if there is a spatial relationship between the red and green objects of the same area (for example, they are colocalized), then there may be a way to set up modules to do this task.

I will address your second question in your later post.

Regards,
-Mark

Dear Mark
I just want to find the cells which have red signal and calculate their cytoplasm area.
but run this module I get the feature like “module 6” in the attach file.
the area are too big to the fact.
please tell me what module I have to add in the pipeline ?
thank you

LWY

to upload image again










Hi LWY,

Based on your images, my understanding is that you want to find only the targeted nuclei from all the labeled nuclei, find all the cells, and then retain only the cells with the targeted nuclei for measurement. Is that correct?

Uploading a pipeline and an example image is usually better than a set of output pictures. If you do that, we’ll be in a better position to help you.

Regards,
-Mark