Matlab says the error is: Cell contents reference from a non

cellprofiler

#1

Hi,
I got an error message, I can not resolve. Is there anyone, who can see the mistake in the pipeline?

There was a problem running the image analysis. Sorry, it is unclear what the problem is. It would be wise to close the entire CellProfiler program in case something strange has happened to the settings. The output file may be unreliable as well. Matlab says the error is: Cell contents reference from a non-cell array object. in the ExportToDatabase module, which is module #17 in the pipeline.

Stack:
CPconvertsql in /Applications/MACI_1.0.5122/CompiledCP/CellProfiler_mcr/CPsubfunctions/CPconvertsql.m (86)
ExportToDatabase in /Applications/MACI_1.0.5122/CompiledCP/CellProfiler_mcr/Modules/ExportToDatabase.m (212)
AnalyzeImagesButton_Callback in /Applications/MACI_1.0.5122/CompiledCP/CellProfiler_mcr/CellProfiler/CellProfiler.m (9409)
gui_mainfcn in /Applications/MACI_1.0.5122/CompiledCP/CellProfiler_mcr/CellProfiler/CellProfiler.m (11138)
CellProfiler in /Applications/MACI_1.0.5122/CompiledCP/CellProfiler_mcr/CellProfiler/CellProfiler.m (55)

This is the pipeline:
Saved Pipeline, in file YR_mitoNeed_morphology_1channelsave_PIPE.txt, Saved on 10-Sep-2008

Pixel Size: 1

Pipeline:
LoadImages
RescaleIntensity
RescaleIntensity
CorrectIllumination_Calculate
CorrectIllumination_Apply
CorrectIllumination_Calculate
CorrectIllumination_Apply
ApplyThreshold
IdentifyPrimManual
IdentifySecondary
IdentifyPrimAutomatic
MeasureObjectAreaShape
MeasureObjectIntensity
MeasureObjectNeighbors
MeasureTexture
Relate
ExportToDatabase

Module #1: 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): tif
What do you want to call these images within CellProfiler? original
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): /
What do you want to call these images within CellProfiler? /
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): /
What do you want to call these images within CellProfiler? /
Type the text that one type of image has in common (for TEXT options), or their position in each group (for ORDER option): /
What do you want to call these images within CellProfiler? /
If using ORDER, how many images are there in each group (i.e. each field of view)? /
What type of files are you loading? tif,tiff,flex movies
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. /Users/admin/Documents/Data/xYARA/080910/210808mitoMorphology
Note - If the movies contain more than just one image type (e.g., brightfield, fluorescent, field-of-view), add the GroupMovieFrames module. .

Module #2: RescaleIntensity revision - 2
What did you call the image to be rescaled? original
What do you want to call the rescaled image? RescaledLow
Rescaling method. (S) Stretch the image (0 to 1). (E) Enter the minimum and maximum values in the boxes below. (G) rescale so all pixels are equal to or Greater than one. (M) Match the maximum of one image to the maximum of another. © Convert to 8 bit. See the help for details. Enter min/max below
(Method E only): Enter the intensity from the original image that should be set to the lowest value in the rescaled image, or type AA to calculate the lowest intensity automatically from all of the images to be analyzed and AE to calculate the lowest intensity from each image independently. 0
(Method E only): Enter the intensity from the original image that should be set to the highest value in the rescaled image, or type AA to calculate the highest intensity automatically from all of the images to be analyzed and AE to calculate the highest intensity from each image independently. 0.5
(Method E only): What should the lowest intensity of the rescaled image be (range [0,1])? 0
(Method E only): What should the highest intensity of the rescaled image be (range [0,1])? 1
(Method M only): What did you call the image whose maximum you want the rescaled image to match? original

Module #3: RescaleIntensity revision - 2
What did you call the image to be rescaled? original
What do you want to call the rescaled image? RescaledHigh
Rescaling method. (S) Stretch the image (0 to 1). (E) Enter the minimum and maximum values in the boxes below. (G) rescale so all pixels are equal to or Greater than one. (M) Match the maximum of one image to the maximum of another. © Convert to 8 bit. See the help for details. Enter min/max below
(Method E only): Enter the intensity from the original image that should be set to the lowest value in the rescaled image, or type AA to calculate the lowest intensity automatically from all of the images to be analyzed and AE to calculate the lowest intensity from each image independently. 0
(Method E only): Enter the intensity from the original image that should be set to the highest value in the rescaled image, or type AA to calculate the highest intensity automatically from all of the images to be analyzed and AE to calculate the highest intensity from each image independently. 0.0165
(Method E only): What should the lowest intensity of the rescaled image be (range [0,1])? 0
(Method E only): What should the highest intensity of the rescaled image be (range [0,1])? 1
(Method M only): What did you call the image whose maximum you want the rescaled image to match? original

Module #4: CorrectIllumination_Calculate revision - 7
What did you call the images to be used to calculate the illumination function? RescaledLow
What do you want to call the illumination function? IllumLow
Do you want to calculate using regular intensities or background intensities? Background
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. 0
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. 8
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. No
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. Gaussian Filter
For MEDIAN FILTER or GAUSSIAN FILTER, specify the approximate width of the artifacts to be smoothed (in pixels), or leave the word ‘‘Automatic’’. 38
If you want override the above width of artifacts and set your own filter size (in pixels), please specify it here. Otherwise leave ‘’/’’. /
(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 save
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 save

Module #5: CorrectIllumination_Apply revision - 3
What did you call the image to be corrected? RescaledLow
What do you want to call the corrected image? CorrLow
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)? IllumLow
How do you want to apply the illumination correction function? Subtract
If you chose division, Choose rescaling method. No rescaling

Module #6: CorrectIllumination_Calculate revision - 7
What did you call the images to be used to calculate the illumination function? RescaledHigh
What do you want to call the illumination function? Illumcell
Do you want to calculate using regular intensities or background intensities? Background
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. 0
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. 35
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. No
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 ‘’/’’. /
(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 save
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 save

Module #7: CorrectIllumination_Apply revision - 3
What did you call the image to be corrected? RescaledHigh
What do you want to call the corrected image? Corrcell
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)? Illumcell
How do you want to apply the illumination correction function? Subtract
If you chose division, Choose rescaling method. No rescaling

Module #8: ApplyThreshold revision - 4
What did you call the image to be thresholded? Corrcell
What do you want to call the thresholded image? Threshcells
Pixels below this value (Range = 0-1) will be set to zero (0 will not threshold any pixels) 0.2
If your answer was not 0, do you want to shift the remaining pixels’’ intensities down by that intensity or retain their original values? Retain
Pixels above this value (Range = 0-1) will be set to zero (1 will not threshold any pixels) 1
If your answer was not 1, you can expand the thresholding around those excluded bright pixels by entering the number of pixels to expand here: 0
Binary option: Enter the threshold to use to make the incoming image binary (black and white) where pixels equal to or below this value will be zero and above this value will be 1. If instead you want to use the settings above to preserve grayscale information, enter 0 here. 0

Module #9: IdentifyPrimManual revision - 2
What did you call the images you want to use to manually identify an object? original
What do you want to call the objects identified by this module? Nuclei
Enter the maximum image height or width (in pixels) to display for the manual identification. Very large images will be resized to this maximum dimension for the manual identification step. Enter “Do not resize” to display the unaltered image. Do not resize
What do you want to call the outlines of the identified objects (optional)? Do not save

Module #10: IdentifySecondary revision - 3
What did you call the primary objects you want to create secondary objects around? Nuclei
What do you want to call the objects identified by this module? Cells
Select the method to identify the secondary objects (Distance - B uses background; Distance - N does not): Distance - B
What did you call the images to be used to find the edges of the secondary objects? For DISTANCE - N, this will not affect object identification, only the final display. Threshcells
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. Otsu Adaptive
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.01
For DISTANCE, enter the number of pixels by which to expand the primary objects [Positive integer] 300
For PROPAGATION, enter the regularization factor (0 to infinity). Larger=distance,0=intensity 0.05
What do you want to call the outlines of the identified objects (optional)? Do not save
Do you want to run in test mode where each method for identifying secondary objects is compared? No

Module #11: IdentifyPrimAutomatic revision - 12
What did you call the images you want to process? CorrLow
What do you want to call the objects identified by this module? mito
Typical diameter of objects, in pixel units (Min,Max): 5,400
Discard objects outside the diameter range? Yes
Try to merge too small objects with nearby larger objects? Yes
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. Otsu Adaptive
Threshold correction factor 1
Lower and upper bounds on threshold, in the range [0,1] 0.015,1
For MoG thresholding, what is the approximate fraction of image covered by objects? 0.01
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. 0
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 /
What do you want to call the outlines of the identified objects (optional)? Do not save
Do you want to fill holes in identified objects? No
Do you want to run in test mode where each method for distinguishing clumped objects is compared? No

Module #12: MeasureObjectAreaShape revision - 3
What did you call the objects that you want to measure? mito
Do not use
Do not use
Do not use
Do not use
Do not use
Do not use
Would you like to calculate the Zernike features for each object (with lots of objects, this can be very slow)? No

Module #13: MeasureObjectIntensity revision - 2
What did you call the greyscale images you want to measure? original
What did you call the objects that you want to measure? mito
Do not use
Do not use
Do not use
Do not use
Do not use

Module #14: MeasureObjectNeighbors revision - 5
What did you call the objects whose neighbors you want to measure? mito
Objects are considered neighbors if they are within this distance, in pixels. If you want your objects to be touching before you count neighbors (for instance, in an image of tissue), use the ExpandOrShrink module to expand your objects: 0
What do you want to call the objects colored by number of neighbors, which are compatible for converting to a color image using the Convert To Image and Save Images modules? Do not save
What do you want to call the image of the objects with grayscale values corresponding to the number of neighbors, which is compatible for saving in .mat format using the Save Images module for further analysis in Matlab? Do not save
Do you want to calculate the extra measures? The extra measures are ‘‘PercentTouching’’ ‘‘FirstClosestObjectNumber’’ ‘‘FirstClosestXVector’’ ‘‘FirstClosestYVector’’ ‘‘SecondClosestObjectNumber’’ ‘‘SecondClosestXVector’’ ‘‘SecondClosestYVector’’ ‘‘AngleBetweenNeighbors’’. No

Module #15: MeasureTexture revision - 2
What did you call the greyscale images you want to measure? original
What did you call the objects that you want to measure? Cells
Do not use
Do not use
Do not use
Do not use
Do not use
What is the scale of texture? 20

Module #16: Relate revision - 2
What objects are the children objects (subobjects)? mito
What are the parent objects? Cells
What other object do you want to find distances to? (Must be one object per parent object, e.g. Nuclei) Nuclei

Module #17: ExportToDatabase revision - 4
What type of database do you want to use? MySQL
For MySQL only, what is the name of the database to use? mitoNeed
What prefix should be used to name the tables in the database (should be unique per experiment, or leave “/” to have generic Per_Image and Per_Object tables)? /
What prefix should be used to name the SQL files? SQL_
Enter the directory where the SQL files are to be saved. Type period (.) to use the default output folder. /Users/admin/Documents/Data/xYARA/080910

Thank you for trying!


#2

Hi,

This error occurs when Matlab tries to fetch NaNs in the ExportToDatabase module. (some of your images may not have objects, for example, so object count would be recorded as NaN) This bug is fixed in the upcoming release, but until then, a workaround could be 1) removing images from your set that produce NaNs (blank images, images without objects, etc) or 2) removing the ExportData module, and instead the ExportData data tool, edit the .csv file to remove the NaNs, and open it up in MySQL.

Let me know if you need any other help.

~kate


#3

Hi,
I ran a few pictures that for sure have objects. Nevertheless, I get the same error message.
Exchanging the ExportToDatabase-module for ExportToExcel yields no error. The excel files do not contain any NaNs.

Can you think of a test I can do to find the problem?


#4

Hi,

I tracked down the error, and it is definitely caused by Matlab looking for an NaN (or Inf) when getting the value of a measurement for creating the MySQL file. This could occur for any of your measurements- for example, in an image where an object has no neighbors (this will just be a blank in Excel, but it’s causing the problem in CPconvertsql).

This should be fixed in the upcoming release.

~kate


#5

The thing is, I erased all measurement- and the relate-module from the pipeline and still get the message.
It cannot be a measurement problem.
I checked the excel and some rows in the Image.xls are empty.
CenterX (Cells, Location) CenterY (Cells, Location) CenterX (mito, Location) CenterY (mito, Location)

Could that be it? What to do to fix it?


#6

Yes, a few measurements are indeed made by modules other than Measure modules. Location, for example, is recorded by Identify modules.

The good news is that the new release of CellProfiler should be available either late today or early next week!
Anne