Save csv data after each image set?

Hello,

sorry in case i asked this already before, but:

is it possible to teach cellprofiler to execute the ExportToSpreadsheet module after each image set, such that we get one output file per image set.
(the way we save them they would not be overwritten, because the output path is constructed from Metadata that is different for each image set)

Best, Tischi

[Moving thread to CP 2.0 Help]

Hi Tischi,

I would try extracting metadata from the filename or path in LoadImages, choosing your regular expression in such a way that it is unique for each cycle. Then, in ExportToSpreadsheet, select the “Data to export”, uncheck the “Use the object name for the file name?” and insert the metadata tag that you created by right-clicking in the “file name” edit box.

What this does is substitute the tag with the actual text that the tag has during that cycle, as determined by LoadImages; CP does the bookkeeping to make sure that measurements associated with each unique tag are written together. If the tag is unique for each image, the csv filename will therefore be unique for each image, and you should get one spreadsheet per image.

Regards,
-Mark

in fact i am doing this already, (i.e. constructing unique filenames for each image set)
but it seems that CP still only writes at the end of all images.

did you test this?
if so, which version of CP does save each unique set of measurements?

thanks! tischi

[quote=“tischer”]did you test this?
if so, which version of CP does save each unique set of measurements?[/quote]

I gave this a try using a modified version of the Examplefly pipeline (attached), using the release version of CP (r10997). It seems to work for me, or is the output not what you want?
-Mark
ExampleFly.cp (6.74 KB)

Hi guys,

Let me resume this discussion as I am facing the same issue Tischi described above.

Is it possible for CellProfiler to save the *.csv files (generated in ExportToSpreadsheet) immediately after each image set is processed?

On my computer all csv files are generated simultaneously once all image sets have been processed. Do note that all image set are independent; i.e. no TrackObjects operation is performed. While the csv files are being written one can see the “Post-procesing, please wait” message next to the progress bar. This is also true for Mark’s ExampleFly.cp.

CellProfiler 2.1.1 (rev 6c2d896)
Windows 10 64-bit

Thanks,
Hugo