IdentifyPrimAutomatic Problem


#1

FYI i am not well skilled in Cell Profiler, and my boss designed the whole pipeline.

Here is the problem:

Normally it loads the image, corrects illumination, converts color FITC filter image to gray, then loads a set of images we made to extract the intensity of areas we selected manually.

I have run this through many times for many data sets and the outputs all work fine. This time i input a data set and it identifies the nuclei selected manually for the first 17 images, finding 22 nuclei that appear in the IdentifyPrimAutomatic as colored dots in the box ‘Identified Nuclei’ the next figure ‘Measureobjectintensity’ gives the 22 nuclei again and info about the intensity. All works fine. BUT, once it gets to image 18, it suddenly finds 0 nuclei and the ‘identified nuclei’ box is grey and empty. The ‘Measureobjectintensity’ box lists 0 nuclei and no intensity data.

i have checked the size, layout, colors, etc. of the #18 images. They are no different in any discernible way from the prior 17.

My boss is not here to help and i am really stuck. Any help would be appreciated. let me know what more info you need to answer my question.

PS. here are the images, the one of the cells and the one of the nuclei i manually drew.




#2

Hi,
did all the other pictures that worked look like the one you showed here in terms of background, in the medium as well as in the cytoplasm. I can imagine it to be hard to find nuclei, because they are very different in intensity and the cell has a background in green.
You might think about staining the nuclei in a second channel and using that one for identification.

I am not a pro either and this was just my first impression of the image.


#3

Hi,

First, I’m not quite sure what you are doing when you say you manually identify the nuclei, and then use IDPrimAutomatic. Do you also use an IDPrimManual, or do you load the masked image you present here and use that for identification (cropping in the shape of the nuclei or something)?

Second, I would check where you are loading the images and double check that you are in fact loading the image you think you are! Maybe you are using regular expressions, and somehow its not loading what you think it is for #18? (some image lacking nuclei, obviously)

Let me know if that helps,
~kate


#4

Probably the quickest way for us to figure out the problem is for you to post the pipeline file (.mat) that you are using, and to post the original and manual images for image set #17 and #18. That will answer Kate’s questions most quickly.

It sounds to me like you are using LoadImages to load the binary (black/white) images that you have manually created outside CellProfiler, then you are using IdentifyPrimAutomatic to identify objects in those images, then you are measuring the intensity of the green image within those identified objects? That should be easily do-able, so something must be strange about the binary image #18, or the settings in IdentifyPrimAutomatic must be not optimal. It should be very trivial to get this working once we know what’s going on!

Anne


#5

ok. long break and still problems.

FYI, i did not design this pipeline, and am still learning how to use cell profiler. just so you are aware…

just to explain better what i am doing. i have a green image with nuclei that get bright and dim and then bright and dim again. this makes any automatic detection of the nuclear intensity VERY difficult. the cells also move around, making it worse. the answer to this has been to draw a black and white image that identifies the area of each nucleus in each frame (done in adobe). as i understand it, CellProfiler loads the green images, does some intensity and illumination corrections, then extracts the intensity of each of the nuclei for each frame (it used the black and white image to ID them).

so normally it loads both images and spits out an excel file with the intensity (an stdev and mean intensity, etc) data for each nucleus, ordered frame by frame. Normally during the identifyprimautomatic part, it tells you how many objects (nuclei here) it found. this worked flawlessly for many datasets, until this one.

the problem now is that it starts fine and counts the right number (20 nuclei for this set) of objects for the first 3 frames, then has a problem. At the 4th frame (and other frames after this) it identifies zero objects and therefor exports empty cells for that frame in excel.

as stated before, i have tried all i know how to do. re-exported the green images, double checked and redrew my adobe files, checked the size and properties of all files, made sure the objects were not too large/small, etc. but to no avail.

here is one set that works:




here is the next frame that doesnt work:




you may also need the background file:
(in next post)

so here is the pipeline:


Saved Pipeline, in file 11-14-07 nuclei-only-PIPE.txt, Saved on 16-Jan-2009

Pixel Size: 1

Pipeline:
LoadSingleImage
LoadImages
ColorToGray
CorrectIllumination_Calculate
CorrectIllumination_Apply
LoadImages
ColorToGray
IdentifyPrimAutomatic
MeasureObjectIntensity
ExportToExcel

Module #1: LoadSingleImage revision - 4
This module loads one image for all cycles that will be processed. Typically, however, a different module (LoadImages) is used to load new sets of images during each cycle of processing. n/a
Enter the path name to the folder where the images to be loaded are located. Type period (.) for the default image folder, or type ampersand (&) for the default output folder. C:\Documents and Settings\elpatri\My Documents\MISL Data\LPS Experiments\Exported TIFFs\BUG 11-14-07 1nM ypestis 37\back
What image file do you want to load? Include the extension, like .tif 11-14-07back.tif
What do you want to call that image? BackrAvg
What image file do you want to load? Include the extension, like .tif Do not use
What do you want to call that image? Do not use
What image file do you want to load? Include the extension, like .tif Do not use
What do you want to call that image? Do not use
What image file do you want to load? Include the extension, like .tif Do not use
What do you want to call that image? Do not use

Module #2: LoadImages revision - 2
How do you want to load these files? Text-Exact match
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): 11-14-07 1nM ypestis 37C
What do you want to call these images within CellProfiler? Orig
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option). Type “Do not use” to ignore: Do not use
What do you want to call these images within CellProfiler? (Type “Do not use” to ignore) Do not use
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): Do not use
What do you want to call these images within CellProfiler? Do not use
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): Do not use
What do you want to call these images within CellProfiler? Do not use
If using ORDER, how many images are there in each group (i.e. each field of view)? 1
What type of files are you loading? individual images
Analyze all subfolders within the selected folder? No
Enter the path name to the folder where the images to be loaded are located. Type period (.) for default image folder. C:\Documents and Settings\elpatri\My Documents\MISL Data\LPS Experiments\Exported TIFFs\BUG 11-14-07 1nM ypestis 37\cells
Note - If the movies contain more than just one image type (e.g., brightfield, fluorescent, field-of-view), add the GroupMovieFrames module. n/a

Module #3: ColorToGray revision - 1
What did you call the image to be converted to Gray? Orig
How do you want to convert the color image? Split
COMBINE options: n/a
What do you want to call the resulting grayscale image? OrigGray
Enter the relative contribution of the red channel 0
Enter the relative contribution of the green channel 1
Enter the relative contribution of the blue channel 0
SPLIT options: n/a
What do you want to call the image that was red? Type N to ignore red. N
What do you want to call the image that was green? Type N to ignore green. OrigGreen
What do you want to call the image that was blue? Type N to ignore blue. N

Module #4: CorrectIllumination_Calculate revision - 7
What did you call the images to be used to calculate the illumination function? BackrAvg
What do you want to call the illumination function? IllumGreen
Do you want to calculate using regular intensities or background intensities? Regular
For REGULAR INTENSITY: If the incoming images are binary and you want to dilate each object in the final averaged image, enter the radius (roughly equal to the original radius of the objects). Otherwise, enter 0. 70
For BACKGROUND INTENSITY: Enter the block size, which should be large enough that every square block of pixels is likely to contain some background pixels, where no objects are located. 70
Do you want to rescale the illumination function so that the pixel intensities are all equal to or greater than one (Y or N)? This is recommended if you plan to use the division option in CorrectIllumination_Apply so that the resulting images will be in the range 0 to 1. Yes
Enter Each to calculate an illumination function for Each image individually (in which case, choose Pipeline mode in the next box) or All to calculate an illumination function based on All the specified images to be corrected. See the help for details. Each
Are the images you want to use to calculate the illumination function to be loaded straight from a Load Images module, or are they being produced by the pipeline? See the help for details. Pipeline
Enter the smoothing method you would like to use, if any. No smoothing
For MEDIAN FILTER or GAUSSIAN FILTER, specify the approximate width of the artifacts to be smoothed (in pixels), or leave the word ‘‘Automatic’’. Automatic
If you want override the above width of artifacts and set your own filter size (in pixels), please specify it here. Otherwise leave ‘‘Do not use’’. Do not use
(For ‘‘All’’ mode only) What do you want to call the averaged image (prior to dilation or smoothing)? (This is an image produced during the calculations - it is typically not needed for downstream modules) Do not use
What do you want to call the image after dilation but prior to smoothing? (This is an image produced during the calculations - it is typically not needed for downstream modules) Do not use

Module #5: CorrectIllumination_Apply revision - 3
What did you call the image to be corrected? OrigGreen
What do you want to call the corrected image? CorrGreen
What did you call the illumination correction function image to be used to carry out the correction (produced by another module or loaded as a .mat format image using Load Single Image)? IllumGreen
How do you want to apply the illumination correction function? Divide
If you chose division, Choose rescaling method. No rescaling

Module #6: LoadImages revision - 2
How do you want to load these files? Text-Exact match
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): black 11-14-07 1nM ypestis 37C
What do you want to call these images within CellProfiler? OrigNuclMaskColor
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option). Type “Do not use” to ignore: Do not use
What do you want to call these images within CellProfiler? (Type “Do not use” to ignore) Do not use
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): Do not use
What do you want to call these images within CellProfiler? Do not use
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): Do not use
What do you want to call these images within CellProfiler? Do not use
If using ORDER, how many images are there in each group (i.e. each field of view)? 3
What type of files are you loading? individual images
Analyze all subfolders within the selected folder? No
Enter the path name to the folder where the images to be loaded are located. Type period (.) for default image folder. C:\Documents and Settings\elpatri\My Documents\MISL Data\LPS Experiments\Exported TIFFs\BUG 11-14-07 1nM ypestis 37\nuclei
Note - If the movies contain more than just one image type (e.g., brightfield, fluorescent, field-of-view), add the GroupMovieFrames module. n/a

Module #7: ColorToGray revision - 1
What did you call the image to be converted to Gray? OrigNuclMaskColor
How do you want to convert the color image? Combine
COMBINE options: n/a
What do you want to call the resulting grayscale image? OrigNuclMask
Enter the relative contribution of the red channel 1
Enter the relative contribution of the green channel 1
Enter the relative contribution of the blue channel 1
SPLIT options: n/a
What do you want to call the image that was red? Type N to ignore red. OrigRed
What do you want to call the image that was green? Type N to ignore green. OrigGreen
What do you want to call the image that was blue? Type N to ignore blue. OrigBlue

Module #8: IdentifyPrimAutomatic revision - 12
What did you call the images you want to process? OrigNuclMask
What do you want to call the objects identified by this module? Nuclei
Typical diameter of objects, in pixel units (Min,Max): 12,50
Discard objects outside the diameter range? Yes
Try to merge too small objects with nearby larger objects? No
Discard objects touching the border of the image? No
Select an automatic thresholding method or enter an absolute threshold in the range [0,1]. To choose a binary image, select “Other” and type its name. Choosing ‘‘All’’ will use the Otsu Global method to calculate a single threshold for the entire image group. The other methods calculate a threshold for each image individually. “Set interactively” will allow you to manually adjust the threshold during the first cycle to determine what will work well. 0.5
Threshold correction factor 1
Lower and upper bounds on threshold, in the range [0,1] 0,1
For MoG thresholding, what is the approximate fraction of image covered by objects? 0.1
Method to distinguish clumped objects (see help for details): Intensity
Method to draw dividing lines between clumped objects (see help for details): None
Size of smoothing filter, in pixel units (if you are distinguishing between clumped objects). Enter 0 for low resolution images with small objects (~< 5 pixel diameter) to prevent any image smoothing. Automatic
Suppress local maxima within this distance, (a positive integer, in pixel units) (if you are distinguishing between clumped objects) Automatic
Speed up by using lower-resolution image to find local maxima? (if you are distinguishing between clumped objects) Yes
Enter the following information, separated by commas, if you would like to use the Laplacian of Gaussian method for identifying objects instead of using the above settings: Size of neighborhood(height,width),Sigma,Minimum Area,Size for Wiener Filter(height,width),Threshold Do not use
What do you want to call the outlines of the identified objects (optional)? Do not use
Do you want to fill holes in identified objects? Yes
Do you want to run in test mode where each method for distinguishing clumped objects is compared? No

Module #9: MeasureObjectIntensity revision - 2
What did you call the greyscale images you want to measure? OrigGreen
What did you call the objects that you want to measure? Nuclei
Do not use
Do not use
Do not use
Do not use
Do not use

Module #10: ExportToExcel revision - 1
Which objects do you want to export? Nuclei
Do not use
Do not use
Do not use
Do not use
Do not use
Do not use
Do not use


#6

here is the background image:


Let me know if anyone needs other info. Thanks.


#7

Hi,

I think your problem is most likely with LoadImages. In your first LoadImages, you ask CellProfiler to load all images that contain the text:
“11-14-07 1nM ypestis 37C"
and in the second
"black 11-14-07 1nM ypestis 37C”

Without an exact list of the files in your directory I can’t be sure, but most likely CellProfiler is loading all the files in the first load images, then again in the second loadimages only the ones with ‘black’ in the name, and at some point IDPrim gets to a cycle where it doesn’t even have an image, so it won’t find anything. I’m not sure why LoadImages doesn’t fail upon startup, because usually this kind of error results in an error dialog that says, 'LoadImages found a different number of images for each channel" and then tells you how many images it found. But, you used two different LoadImages modules, which I’ve never tried, and Im not sure how CellProfiler would react.

try: renaming your images Nuclei11407… and Black111407… and loading them based on matching ONLY the Nuclei (for nuclear channel) and Black (for the mask).

-Kate


#8

i don’t think this is the problem. i have run at least 20 data sets identical to these using the same naming system with no problems. i double checked all the file names to be sure that they were correct and correlated, and there is still an error.


#9

OK, I think I see your problem.

Your black 21C018 image has a bright white border around the image, while your black 37C001 image has a light gray border around it. This is a subtle difference, but when you threshold using 0.5 in IdentifyPrimAutomatic, it’s catching the border in 21C018 (which is higher than 0.5 in intensity) and not catching it in 37C001 (since it’s lower than 0.5). This means that the entire 21C018 image is being identified as an object and is being filled in, which gives you no interior objects.

The most straightforward way to solve this is to insure that your black images do not have a border around them. Is this an option for you?
-Mark