cellprofiler user manual

16
CellProfiler User Manual SELECTING IMAGES TO BE PROCESSED 2 BUILDING THE ANALYSIS PIPELINE 4 IDENTIFYING PRIMARY OBJECTS 4 RELATE OBJECTS 6 IDENTIFY SECONDARY OBJECTS 7 IDENTIFY TERTIARY OBJECTS 10 MEASURE OBJECT INTENSITY 11 MEASURE OBJECT SIZE & SHAPE 12 OVERLAY OUTLINES 13 SAVING IMAGES 14 EXPORT MEASUREMENTS TO SPREADSHEET 16 RUNNING THE PIPEPLINE 16

Upload: others

Post on 22-Apr-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CellProfiler User Manual

CellProfiler User Manual

SELECTING IMAGES TO BE PROCESSED 2

BUILDING THE ANALYSIS PIPELINE 4

IDENTIFYING PRIMARY OBJECTS 4

RELATE OBJECTS 6

IDENTIFY SECONDARY OBJECTS 7

IDENTIFY TERTIARY OBJECTS 10

MEASURE OBJECT INTENSITY 11

MEASURE OBJECT SIZE & SHAPE 12

OVERLAY OUTLINES 13

SAVING IMAGES 14

EXPORT MEASUREMENTS TO SPREADSHEET 16

RUNNING THE PIPEPLINE 16

Page 2: CellProfiler User Manual

CellProfiler Key Concepts 1. Project-This is a container for the following, the list of image files & where they

reside, the associated image metadata, the analysis pipeline (analysis recipe). The project does not save a copy of the images themselves, only the file path to them. The project is saved automatically as it is updated with the extension .cpproj. You can save it to a location initially using File>Save Project As.

2. Pipeline-A sequential set of image analysis modules which you can apply to a group of images. The pipeline is stored within the Project file but you can also export it to make it available for import into new Projects. The pipeline extension is .cppipe.

Selecting images to be processed 1. The features of CellProfiler are broken down into Modules which appear in the left

hand margin known as the Pipeline & by default some modules will be present when you open the software.

2. For instance, you will be presented with the Images module. Drag and drop any folders containing images that you want to process to the area indicated. CellProfiler can read any image file format but there may need to be some dimension adjustments for some file types described below.

3. It will produce one row for each folder & show the file path to each image.

4. You can remove any images you don’t want to process by right clicking on the images then select “Remove from File List”.

Page 3: CellProfiler User Manual

5. In order that CellProfiler displays the image correctly, select the Metadata module found in the left margin. Select the options shown below & press Update metadata.

6. Press the lower Update button to display a table showing how the metadata has been interpreted.

7. In the case of Micro-Manager 2D multi-channel OME.TIFF files, the channels will be mistaken as time-points or “Frame” as highlighted by the red box above. However, what we can do is consider Frame to be Channel & name the Frames as the relevant channel name.

8. To do this select the NamesAndTypes module from the left margin. In our example we have 3 channel Micro-Manager OME.Tiff files. Below shows how to assign a name to one of the channels in each image, use the settings in the image below as a template to configure your images. In this case, Frame 0 = FITC, Frame 1 = TxRd & Frame 2 = DAPI. Below shows how to name frame 0 in each image as FITC:

Page 4: CellProfiler User Manual

9. Press the Add another image button to replicate the procedure to name your second

channel and then your third etc. 10. Press Update to see the table of images to which this rule has been applied:

Building the analysis pipeline

Identifying Primary Objects 1. A primary object is required by CellProfiler and examples could be nuclei or vesicles,

they are usually objects found inside the cell.

2. To access the other modules available select the Adjust modules + button found under the Modules section on the left:

3. Select the Object Processing Module Category>IdentifyPrimaryObjects (works for 2D images only)

4. Each option has a “?” next to it which will give a brief explanation of what it does.

5. If you leave Advanced settings on “No” the underlying parameters encompassed by

Advanced will be set to default values.

6. Select the channel that you want to use to identify objects e.g. for nuclei choose DAPI & give those objects a relevant name e.g Nuclei.

Page 5: CellProfiler User Manual

7. There is a size filter for the objects and a choice as to whether objects outside that range should be discarded. Also, if some objects touch the image border they can also be discarded. It is common to use both of these features.

8. At any point as you build your pipeline you can test it on an image by selecting Start Test Mode in the bottom left corner.

9. Press Run & a window will open showing what has been identified in the first image.

10. When you have added multiple analysis modules you can press the Step button to move through each module in turn so you can see what each has done.

11. You’ll see a panel of images, top left is the image being processed, top right shows

what it has detected as objects as different coloured areas, bottom left shows an outline version, bottom right shows statistics from the image.

12. If the identification has not been accurate then you may want to Exit Test Mode & enable the Use Advanced Settings option within IdentifyPrimaryObjects.

13. A useful module when two objects are close and have been identified as one is Object Processing>SplitOrMergeObjects:

14. Repeat steps 2-12 if you have additional channels which contain what you’d consider to be primary objects. In our example we have a second Primary Object which is Phosphohistone H3 (PH3).

Page 6: CellProfiler User Manual

Relate Objects 1. If there is a relationship between two sets of objects found in different channels i.e.

one is found inside the other then this could be classed as a “parent” “child” relationship. An example of when this would be useful is if you wanted to relate the number of “child” objects within each “parent” object e.g. counting spots in individual nuclei

2. Go to Adjust Modules>Object Processing>Relate Objects select which object is the parent & child:

3. Select whether you want to calculate per parent mean values for each child & whether child-parent physical distances should be calculated, the options for the latter are centroid, minimum or both. An example for this is if you wanted to know whether nuclear spots were more centrally located within the nucleus or periphery.

4. If you only want information about objects (children) that are within nuclei (parent) then select Yes for the “Save the children with parents as a new object set” option. In this case this will discard objects not found within the nuclei & the result will show only nuclei that have PH3.

Page 7: CellProfiler User Manual

Identify Secondary Objects 1. Secondary objects are determined based on Primary objects, therefore the former

must be identified before you can add a Secondary Objects module. Whether you need the Secondary Objects module depends on the content of your images. There has to be one primary object associated with each secondary object & the primary must be completely contained by the secondary. An example for using it would be to find the cell boundary using the nucleus of each cell as a seed point to grow out from until it meets the boundary.

2. Add the Object Processing>IdentifySecondaryObjects module, select the channel/image in which you have a cell/membrane marker as the Image Input.

3. Select one of the primary objects as the Input Object e.g. nuclei

4. Add a name for the secondary objects e.g. Cells

5. Select the method for identifying the secondary objects, this should pick up the dividing lines between adjoining cells to distinguish them. There are several methods for doing this & you can see more details by pressing the “?”. For those that know it, the Propagation method is considered an improvement over the traditional Watershed method.

6. Most of the time the Global strategy for threshold will be suitable & only change to Adaptive if there are big variations in background intensity across the image. Setting a threshold is the process of identifying foreground (structures of interest) from background using the images intensity histogram.

2

3

4 55 6

7

8

8

9 10 11 12

13

14

Page 8: CellProfiler User Manual

7. In Thresholding method you can choose an automatic or manual threshold. Otsu is selected by default & is often used for automatic thresholding. By using automatic threshold you will find the threshold level changes for each image & can be used if you have inconsistent intensity variation between images. However, it does introduce a variable that you don’t have control over. As images should have been captured with the same settings, hopefully they are consistent & therefore a manual threshold could be used. When you set to Manual there are two inputs, Manual threshold between 0.0 – 1.0 & a Regularisation factor (uses distance to nearest primary object & the intensity of the secondary object image). To test how changing these values changes the threshold result you will need to Use the Test Mode to Step through the modules as described earlier.

8. Two class or three class thresholding. Two class will separate the image intensities into two classes i.e. background and foreground. With three class, the third class i.e. a middle intensity between the other two classes. An example, bright nucleus staining would be one class, dim non-specific cytoplasmic staining would be a second & the background a third class. You can alter how the second (middle) class is ultimately considered-either it will be considered background or foreground using the Assign pixels option. If you only wanted to threshold the nucleus in the above example then you would use three class, the non-specific staining & background would both become background.

9. Threshold smoothing scale can be used to smooth the image prior to thresholding & helps remove image noise that can cause jagged edges to objects which would reduce object thresholding accuracy. The smoothing scale value should be approximately the size of the artefacts to be eliminated by the smoothing.

10. Threshold correction factor allows a uniform adjustment to the threshold method chosen above e.g. Otsu. The threshold is multiplied by the value entered here. 1 = no change, <1 would make threshold more lenient & >1 more stringent. As an example, Otsu assumes that 50% of the image is covered by objects, if a larger proportion is covered Otsu will give biased result which could be corrected with this setting.

11. Lower & upper bounds on threshold. When the auto threshold is outside of a reasonable range, the min/max bounds will override it. As an example, if there are no objects in the field of view the auto threshold might be calculated low & include background as foreground. By increasing the lower bound this would eliminate these false positives.

12. Regularisation factor determines where the dividing line is between two touching secondary objects e.g. neighbouring cells. It takes into account the distance to the nearest primary object e.g. nucleus & the intensity of the secondary object image. A value of 0 means the distance to the nearest primary object is ignored & the decision is made on the intensity gradient between the two competing primary objects. Values >0 will put more weight on the distance between the two objects. Small

Page 9: CellProfiler User Manual

changes e.g. 0.01 to 0.001 will yield quite different results. At a value much >1 the intensity image is almost completely ignored.

13. Fill holes in identified objects would normally be selected for secondary objects because you’re trying to ascertain where the periphery or membrane of each cell is.

14. Discard secondary objects touching the border is usually set to Yes as normally its

best to avoid counting incomplete cells where information can be missing.

15. If you run Test Mode and Step through to IdentifySecondaryObjects you will see how well the cells have been identified. You may have to adjust the settings & run test mode again.

Page 10: CellProfiler User Manual

Identify Tertiary Objects 1. Tertiary objects are those found inside the cell but not in the nucleus e.g organelles.

This would enable you for example to count the number of a certain object in the cytoplasm vs the nucleus e.g. vesicles. If you need to identify any of these, add the Object Processing>IdentifyTertiaryObjects module

2. Select which object class is the smaller/larger in the two drop down menus & name the tertiary objects, the result will be a subtraction of the smaller object e.g. nucleus from the larger e.g. cell to leave the cytoplasm.

3. Shrink smaller objects prior to subtraction, if selected this will ensure a tertiary object is produced. If you don’t do this, pixels will be shared between the different object classes and measured multiple times. However, this should have a limited impact on your results.

Page 11: CellProfiler User Manual

Measure Object Intensity 1. Now the cell has been divided up into different object classes, Nucleus, cytoplasm &

cell, it needs to be decided what is to be measured within each. For intensity measurements add the Measurement>MeasureObjectIntensity module.

2. Firstly, define which of your channels should be measured from the Image to measure dropdown list. To add another channel/image press the Add another image button.

3. Now select the objects to be measured from the Select object dropdown list. To add another object press the Add another object button.

4. If you run Test Mode and step through to the above step the result will be a window containing a results table. The module measures a series of common intensity statistics e.g. Mean, Min/Max, standard deviation etc. The order of the results is like so: 1st image-object 1 results 2nd image-object 1 results

-object 2 results -object 2 results -object 3 results -object 3 results etc

Page 12: CellProfiler User Manual

Measure Object Size & Shape 1. To measure size & shape features of your objects add the

Measurement>MeasureObjectSizeShape module.

2. Features measured include Eccentricity, Major/minor axis length, Orientation, Area, Centre XYZ, Compactness, Extent, Perimeter, Solidity, Form factor, Euler number, Maximum radius, Mean radius, Median radius, Max/min ferret diameter, Zernike shape features if selected.

3. Select the first object you want to measure from the dropdown list. The image below shows 3 objects have been added in this case.

4. To add another object to be measured, select add another object.

5. You can also remove an object if you decide it shouldn’t be measured using Remove

this object button.

6. There is an option to measure Zernike features but this is computationally very intensive & can extend how long the pipeline takes to complete & these features will not be useful to most.

7. All measurements will in object order e.g. Nuclei measurements followed by Cells etc.

Page 13: CellProfiler User Manual

Overlay Outlines 1. To place outlines around measured objects on a desired image add the Image

Processing>OverlayOutlines module.

2. Outlines can be placed on a blank black image if you select Yes but its more useful to see the outlines overlayed on your actual images, in which case select No.

3. Select the image you want the overlay to appear on, this will be a duplicate of the

original image.

4. Give this new overlay image a name.

5. Outlines can be in colour or greyscale.

6. The outline can be placed just inside the object leaving background pixels untouched (Inner) or place the outline on background pixels just outside each object (Outer) or make the outline thicker-2 pixels wide (Thick).

7. Now select which object overlay should be shown on the DNA image from the

dropdown list. Also select the colour for this object outline.

8. As in this example where 3 overlays have been added to the DNA image, if you want to add more object overlays to one image press Add Another Outline

2

3

4 5

6

7

8

Page 14: CellProfiler User Manual

Saving Images 1. If you want to save the new overlay outlines image add the SaveImages module,

from File Processing>SaveImages.

2. Select Image in Type of image to save.

3. Select the name of the image.

4. Select the File name construction method. From image file name will name this file based around the name of the input images as defined in the NamesAndTypes module alternatives options are based around sequential numbering or a single name defined manually via a text box.

5. When the image name is to be based on a filename from an input image you can add a prefix, so if the overlay was placed on the DNA image it would make sense for the prefix to be associated with that.

6. A suffix enables you to add your own text which should be included in the image file name.

7. Choose the format that the overlay image should be saved as, the options are jpg, png, tiff or npy.

8. Choose the folder where this image should be stored, there are several options but the most relevant are “Same folder as image” & “Elsewhere…”

9. Overwrite existing files without warning, relevant for when running on a cluster as you won’t be able to interact so select Yes in this case.

10. When to save images in the pipeline cycle, “Every cycle” would be after each original image has been analysed & should be used when images will be generated for each input image. “First cycle” is useful when an image is generated just once during the first cycle of the pipeline e.g. a correct illumination image that is used for all images to be analysed.

11. Record the file & path information to the saved image is useful to have.

Page 15: CellProfiler User Manual

12. Create subfolders in the output folders creates folders at this location with the naming structure of the input image. E.g. if you want each analysed image to go into its own folder once processed.

2

3

4

5

6

7 8

9

10

11

12

Page 16: CellProfiler User Manual

Export measurements to Spreadsheet 1. This module is found under Data Tools>ExportToSpreadsheet & gives a series of

options for how measurements made should be added to a results spreadsheet. Below is more information on the settings that are not self-explanatory.

2. Representation of NaN/Inf will put “NaN” or “Inf” which stand for “Not a Number” & “Infinite” respectively, into any spreadsheet cell when CellProfiler cannot make sense of the value that has been returned.

3. Select the measurement to export option, adds a button so that you can interact & choose which specific measurements of those recorded should be added to the spreadsheet. It’s a means of filtering so as to not overcrowd the table.

4. Create a GenePattern GCT file will not be required by most. With a GCT file you can make use of GenePattern’s data visualisation & clustering methods used for genomic data.

Running the Pipepline 1. It’s a good idea to run Test Mode on a single image before you proceed & run the

pipeline on all images.

2. Once it has been tested you can run the pipeline by pressing Analyse Images

2

3

4