Create cell crops with CellProfiler#

While it is possible to segment/annotate and classify objects entirely within Piximi, you can also use CellProfiler to segment individual cells and create single cell cropped images that can be then be opened in Piximi and then categorized.

This guide explains how to create a CellProfiler pipeline that will first identify nuclei using the IdentifyPrimaryObjects module, followed by cell identification with the IdentifySecondaryObjects module. We will then create a multichannel RGB image with DNA colored blue and GFP colored green. Finally, these multichannel RGB images will be cropped based on the previously identified cell object using the SaveCroppedObjects module.

The single cell image crops for the Piximi Human U2OS-cells Cytoplasm Crops example project were made using this workflow. The images are from the BBBC013 cytoplasm-nucleus translocation dataset from the Broad Bioimage Benchmark Collection. The CellProfiler pipeline used in the following example can be downloaded here for CellProfiler version 4.2.2. For CellProfiler 4.2.1 or earlier, download this pipeline.

1. Import images#

To begin, drag and drop your images into the Images input module of CellProfiler.

_images/user-guide-images-input-view.png

Fig. 19 Drag and drop your images into the Images input module.#

Next, select appropriate rules to categorize your files in the NamesAndTypes input module. In these images, files that contain Channel2 in their filename are assign the name rawDNA and images that contain Channel1 in their filename are assigned the name rawGFP.

_images/user-guide-names-and-types-view.png

Fig. 20 Within the NamesAndTypes module, assign appropriate names for the DNA and GFP channels.#

2. IdentifyPrimaryObjects#

Then, add an IdentifyPrimaryObjects module and set your DNA image (e.g. rawDNA) as the input image. Name this primary object Nuclei. Adjust the parameters so an appropriate segmentation is achieved while using test mode.

_images/user-guide-identify-primary-object-view.png

Fig. 21 Add a IdentifyPrimaryObjects module and adjust the parameters to achieve adequate object segmentation of the rawDNA image.#

3. IdentifySecondaryObjects#

Add an IdentifySecondaryObjects module and select the cell image (e.g. rawGFP) as the input image and Nuclei as the input objects. Name this Secondary object Cells. You can tune segmentation parameters to identify your cell objects or set the Distance - N method to identify secondary objects with a distance that captures the edge of most cells (e.g. 10).

_images/user-guide-identify-secondary-object-view.png

Fig. 22 Add a IdentifySecondaryObjects module using the rawGFP as an input image and Nuclei as in input object.#

4. GrayToColor#

Now, we will create a multichannel RGB image using the input rawDNA and rawGFP images. Add a GrayToColor module and select rawGFP to be colored green and rawDNA to be colored blue. Name the output image GFPandDNA.

_images/user-guide-color-to-gray-view.png

Fig. 23 Add a ColorToGray module and set the rawGFP as green and rawDNA as blue.#

5. SaveCroppedObjects#

Next, add a SaveCroppedObjects module and select the Cells objects from IdentifySecondaryObjects. For the Image to crop setting, select GFPandDNA created by the ColorToGray module. It is this image that will be cropped to individual Cells objects. Select an appropriate directory to save your cropped images.

_images/user-guide-save-cropped-objects-view.png

Fig. 26 Add a SaveCroppedObjects module and select your desired Object and the Image to crop. In CellProfiler 4.2.2 you can select to save crops into nested folders with the input image filename.#

Copyright

The BBBC013 images used here are licensed under a Creative Commons Attribution 3.0 Unported License by Ilya Ravkin.