Save individual cropped cells as image

Hey all,

I am trying to export each individual segmented cell as its own image file. I know it is possible to do this on a single image by saving the object mask using the SaveCroppedObjects module and creating a new pipeline to match up and crop the original image, but I have hundreds of images to analyze. Is there a way to do this for many images using CellProfiler or should I use additional software?

Thanks so much!


We’re actively considering (like, in the next week or two) adding this functionality to the software, but for now your only option is indeed to first run a pipeline that takes all your hundreds of images and makes masks for each with SaveCroppedObjects (we strongly suggest saving each image’s masks into a folder with that image’s name, which you can do using the “DefaultOutputFolder-Subfolder” save option), then run a second pipeline to apply the masks to your images (and optionally crop them down). It can be done though, and we do it in the lab.

1 Like


Thank you for the response but I was able to do this by writing a simple new version of the SaveCroppedObjects module.

Hi chriskbu,

I don’t know if it’s unusual to ask for such thing on this forum but would you mind sharing your modified module?
I think this could be very useful!!!

Thanks a lot!



I am also trying to save cropped objects. I tried the “DefaultOutputFolder-Subfolder” save option to save into a subfolders titled with the image name. Is there a variable that should be placed into the subfolder title so that this is done for each image automatically for each repetition through the pipeline? What I’m observing is that the title of subfolders needs to be specified for each image manually.

Thank you

After more tinkering with CellProfiler, I realized that I can use the Metadata labels to name subfolders, using the “DefaultOutputFolder-Subfolder” option, according to each image’s/image set’s metadata. The Metadata labels are accessible by right-clicking in the subfolders field.


Hi bcimini,

thank you for your help!
A follow-up question: does the current v.3.1 version of Cell Profiler already contain such an option?

Best, Niklas

Hi Niklas,

3.1.5 does not have it, but we HAVE done it, so you can get it if you run CP from source. Otherwise, look for it in our next release!