Retreive Metadata associated with saved images

Hello,

I have a pipeline which accepts an image, crops it into multiple small sections using masks, and then thresholds the cropped area to measure the total intensity in the region. Essentially, I am trying to find the ratio of black/white in an area. I am successfully measuring the intensity at each iteration, however I need to correlate this with date/time information which is in the name of the original image. I have already extracted this using the metadata command in the Load Images module, and am using this metadata to name each saved cropped and threshold image. My question is how to pass this metadata to my output file. I am making an import script in Matlab, and need to import intensity values correlated with the date/time information contained in the metadata. I have tried the “store file and path information to the save image” check box in the SaveImages module, however, I cannot find where this information is stored in the output file.

I’ve included my pipeline and an example image and mask in this post

Thanks for your help, and a great piece of software!





StLawrenceBatchfirstpositionnoalign.cp (123 KB)

Hi,

You need to add an ExportToSpreadsheet module. This will create an Image.csv file (among others) which should include columns named "Metadata<Your_Metadata_Tags>", assuming they are extracted properly.

A side note: I’m not sure, but looking at your (long!) pipeline, you might take a look at the DefineGrid and Tile modules to possibly streamline it.

And quite a novel use of CP, I must say! Might I ask, what are you studying?

Best,
David

Thanks for your quick response, that solved it and will let me pull the metadata from each image.

I’m looking at identifying snow loss and shedding mechanisms on solar panels, the test site you see there is the Open Source Outdoors Test Field (appropedia.org/Open_Solar_Ou … Test_Field), and we are using data from it to better model solar systems. Cell profiler was a great package that allows us to identify and quantify snow cover on a panel, in an intuitive package. Perhaps it should be re-named (Solar)Cell Profiler…

Thank you for your recommendation, however the masks are required to identify exactly where each panel is, and are not laid out in a grid, as I think is required for Define Grid.

Two issues i’m coming up on down the road: I would like to export as an image just the masked area, not the full frame of the image, is there an easy way to do this? Also, I am running this through a continuous time lapse of images, approaching 10,000 images across two sites. At the moment this is manageable, however I need to do a manual parallelization of the program to get reasonable computation times. Essentially, I divide the photos into five chunks in separate folders, and run 5 instances of cell profiler simultaneously. This works pretty well on a multi-threaded CPU, but it would be a fairly easy feature to implement into the code of cell profiler. Either allow the user to define how many photos in a series they want to process with a given instance of cell profiler. Or, even better, allow them to define how many instances to run, and automatically divide the image sets, run each one independently, and concatenate the output files at the end.

Cheers,

Rob

The Crop module allows for the removal of the zeroed rows and columns, which you can then save. Unfortunately, you’d have to put a Crop module for each panel that you want saved.

We are working on implementing multi-threading in CP but it’s a work in progress. However, you can run CP without the GUI (e.g., “headless”) and pass arguments that specify the first and last image numbers to process. That way you can run multiple instances of CP, each working on an independent subset of images. See Help > Other features > Batch processing for more information.

Regards,
-Mark

Hello,

I have another question related to this pipleline which I am just coming back to. I am using the align module as the camera shifts slightly over time. I would like the align module to always align to the baseline image which I used to create the masks to ensure everything lines up, however when I run it it seems to go to the average between both images (The baseline and the new image), and therefore my masks do not line up with the panels. Is there a way to force one image to be stationary as the align module runs? I am using crop mode: Keep Size, and Alignemnt method: Normalized Cross Correlation for this.

Cheers,

Rob

Hi Rob,

The first image in the Align module should be the reference image (we may need to check the documentation to make sure this is noted correctly); it should remain stationary while the other images shift with respect to it. Let us know if this is not the case in your experiment.

Regards,
-Mark