Error with CorrectIlluminationCalculate

Hi I am trying to get CorrectIlluminationCalculate, but it is returning the following error:
Error while processing CorrectIlluminationCalculate:
‘NoneType’ object has no attribute 'pixel_data.

I have copied the error report here:

File “cellprofiler\pipeline.pyc”, line 302, in run
File “cellprofiler\modules\correctilluminationcalculate.pyc”, line 305, in run
File “cellprofiler\cpimage.pyc”, line 499, in get_image

I am using Windows 7 64bit. I downloaded and installed the 64bit version of Cell profiler.

Any assistance would be greatly appreciated. Thank you


Could you post your pipeline to the forum so we could take a look?


Hi Mark
Thank you
I am not sure how much detail you need but here are the entire contents of the pipeline:
CellProfiler Pipeline:

File type to be loaded:individual images
File selection method:Text-Exact match
Number of images in each group?:3
Type the text that the excluded images have in common:Do not use
Analyze all subfolders within the selected folder?:No
Input image file location:Default Input Folder\x7CNone
Check image sets for missing or duplicate files?:Yes
Group images by metadata?:No
Exclude certain files?:No
Specify metadata fields to group by:
Text that these images have in common (case-sensitive):
Name this loaded image:Y1H
Position of this image in each group:1
Extract metadata from where?:None
Regular expression that finds metadata in the file name:^(?P.)_(?P\x5BA-P\x5D\x5B0-9\x5D{2})_s(?P\x5B0-9\x5D)
Type the regular expression that finds metadata in the subfolder path:.

Select the input image:Y1H
Conversion method:Combine
Name the output image:OrigGray
Relative weight of the red channel:1
Relative weight of the green channel:1
Relative weight of the blue channel:1
Convert red to gray?:Yes
Name the output image:OrigRed
Convert green to gray?:Yes
Name the output image:OrigGreen
Convert blue to gray?:Yes
Name the output image:OrigBlue

Specify which images?:Images to remove
Select image to remove:OrigGray

Select the input image:OrigGray
Name the output image:IllumBlue
Select how the illumination function is calculated:Regular
Dilate objects in the final averaged image?:No
Dilation radius:1
Block size:60
Rescale the illumination function?:Yes
Calculate function for each image individually, or based on all images?:Each
Smoothing method:No smoothing
Method to calculate smoothing filter size:Automatic
Approximate object size:10
Smoothing filter size:10
Retain the averaged image for use later in the pipeline (for example, in SaveImages)?:No
Name the averaged image:IllumBlueAvg
Retain the dilated image for use later in the pipeline (for example, in SaveImages)?:No
Name the dilated image:IllumBlueDilated

Select the input image:OrigGray
Name the output image:CorrBlue
Select the illumination function:OrigGray
Select how the illumination function is applied:Divide
Select the rescaling method:No rescaling

Select the input image:CorrBlue
Name the primary objects to be identified:spots
Typical diameter of objects, in pixel units (Min,Max):10,40
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?:Yes
Select the thresholding method:Otsu Global
Threshold correction factor:1
Lower and upper bounds on threshold:0.000000,1.000000
Approximate fraction of image covered by objects?:0.01
Method to distinguish clumped objects:Intensity
Method to draw dividing lines between clumped objects:Intensity
Size of smoothing filter:10
Suppress local maxima that are closer than this minimum allowed distance:7
Speed up by using lower-resolution image to find local maxima?:Yes
Name the outline image:PrimaryOutlines
Fill holes in identified objects?:Yes
Automatically calculate size of smoothing filter?:Yes
Automatically calculate minimum allowed distance between local maxima?:Yes
Manual threshold:0.0
Select binary image:None
Retain outlines of the identified objects?:No
Automatically calculate the threshold using the Otsu method?:Yes
Enter Laplacian of Gaussian threshold:0.5
Two-class or three-class thresholding?:Two classes
Minimize the weighted variance or the entropy?:Weighted variance
Assign pixels in the middle intensity class to the foreground or the background?:Foreground
Automatically calculate the size of objects for the Laplacian of Gaussian filter?:Yes
Enter LoG filter diameter:5
Handling of objects if excessive number of objects identified:Continue
Maximum number of objects:500

Select objects to measure:spots
Calculate the Zernike features?:Yes

Name the grid:Grid
Number of rows:8
Number of columns:12
Location of the first spot:Top left
Order of the spots:Rows
Define a grid for which cycle?:Each cycle
Select the method to define the grid:Automatic
Select the previously identified objects:spots
Select the method to define the grid manually:Mouse
Select the image to display:None
Coordinates of the first cell:0,0
Row number of the first cell:1
Column number of the first cell:1
Coordinates of the second cell:0,0
Row number of the second cell:1
Column number of the second cell:1
Retain an image of the grid for use later in the pipeline (for example, in SaveImages)?:No
Name the output image:Grid
Select the image on which to display the grid:Leave blank
Use a previous grid if gridding fails?:No

Select the defined grid:Grid
Name the objects to be identified:Wells
Select object shapes and locations:Rectangle Forced Location
Specify the circle diameter automatically?:Automatic
Circle diameter:20
Select the guiding objects:None
Retain outlines of the identified objects?:No
Name the outline image:GridOutlines

It seems that there are a few things amiss in this pipeline:

  • LoadImages: You have nothing specified in “Text that these images have in common…”. You should specify a text string here.

  • You are removing the OrigGray image with ConserveMemory but then using it in CorrectIlluminationCalculate (which is the source of the error you got). You should remove the ConserveMemory module.

Hope this helps!

Thanks Mark I am not getting the error now but… Cell Profiler gets to the step where it runs
Identify primary objects it is taking forever and using 6gig or ram. Any ideas on what I could be doing wrong that could cause this. Thank you

This can occur if you have a very large image and/or a lot of objects are being detected and segmented. How big are your images (i.e, width and height in pixels, as well as size of the image file itself).


Hi Mark I think it had something to do with how I had the pipeline setup. It is not happening now. The images are
4272 x2848, and a little over 3mb in size.

Hi when I try to adapt the example:
Identifying, measuring, and classifying yeast colonies
to my data it is using up all of my memory, and I have to basically restart my machine.
Here is what the images look like:

In both cases Yeast colonies are being analysed. In my example I want to determine where blue colonies are forming. Do you have any ideas as to why this is not working, I am getting as far as CorrectIlluminationApply before my computer freezes. It is a Lenovo T410 running a 2.67ghz i7 intel processor, with 8gb of ram running Windows 7 64bit pro. I am using the 64bit version of Cell Profiler as well. Thank You

Could you upload your revised pipeline to this thread? (using the “Upload attachment” tab below the reply text box)

Hi Mark sorry for taking so long to get back to you. I was just working with Adam Fraser on your team and he helped me get through many of the problems that I have been having, mostly due to operator error. I have attached my latest pipeline. I have also attached some images showing the results that I have gotten so far. One of the issues was size of images that is now down to .1.
The issues that I am having now are as follows:
The automatic grid is not covering the whole plate.
Not all of the colonies that are exhibiting both growth and color are being detected.
Large colored regions like the ones in the plate image that I supplied are not really being quantified.

In the end what I would love to be able to do is to detect all of the colonies on a plate then to be able to say, x,y,z colonies are blue and of those apply some sort of value to measure how blue they are. I understand that the latter might be a lofty goal but it is good to have them :smile:

Any help would be greatly appreciated.

Thank you

PlatePipeLinev2_resize_A.cp (12.6 KB)