CPA crashed when I try to load RGB images


#1

Hello,

I have a problem with loading cellprofiler analyst, and it crashes everytime when I load the properties file.

I use the newest cellprofiler analyst 2.2.1 version and it works fine before. However, I was trying to view RGB files and I tried the method that is described here:

I changed the scripts from:

image_path_cols = Image_PathName_RawData,Image_PathName_OverlappedWormOutlines
image_file_cols = Image_FileName_RawData,Image_FileName_OverlappedWormOutlines
image_thumbnail_cols =
image_names = RawData,OverlappedWormOutlines
image_channel_colors =

to:
image_path_cols = Image_PathName_RawData,Image_PathName_OverlappedWormOutlines
image_file_cols = Image_FileName_RawData,Image_FileName_OverlappedWormOutlines
image_thumbnail_cols =
image_names = RawData,OverlappedWormOutlines
image_channel_colors = red, green, blue
channels_per_image = 3
image_channel_blend_modes = add, add, add

after that, I started to have the crashing problem.

in the log file, it shows:

INFO:root:No PIL.ArgImagePlugin
WARNING:root:PROPERTIES WARNING: Unrecognized field “series_id” in properties file
WARNING:root:PROPERTIES WARNING: Unrecognized field “group_id” in properties file
WARNING:root:PROPERTIES WARNING: Unrecognized field “timepoint_id” in properties file
Traceback (most recent call last):
File “CellProfiler-Analyst.py”, line 557, in
File “CellProfiler-Analyst.py”, line 449, in Start
File “cpa\guiutils.pyc”, line 818, in show_load_dialog
File “cpa\properties.pyc”, line 330, in load_file
File “cpa\properties.pyc”, line 573, in Validate
AssertionError: PROPERTIES ERROR: channels_per_image must have the same number of values as image_file_cols and image_path_cols.

I have updated java, but it did not solve the problem

Could anyone help me figure out what is going wrong and what I should do to solve it?

Thanks,

Wenfan


#2

Hi,

Try this:

image_path_cols = Image_PathName_RawData,Image_PathName_OverlappedWormOutlines
image_file_cols = Image_FileName_RawData,Image_FileName_OverlappedWormOutlines
image_thumbnail_cols =
image_names = RawData_Red, RawData_Green, RawData_Blue, OverlappedWormOutlines
image_channel_colors = red, green, blue, grey
channels_per_image = 3, 1
image_channel_blend_modes = add, add, add, add

And see if that works. I’ve not tried it, I’m just basing it off this in the properties file template:

# Number of channels present in each image file?  If left blank, CPA will expect 
# to find 1 channel per image.
#
# eg: If the image specified by the first image_channel_file field is RGB, but
# the second image had only 1 channel you would set: channels_per_image = 3, 1
# Doing this would require that you pass 4 values into image_names,
# image_channel_colors, and image_channel_blend_modes

#3

Thanks for the reply!

There is only 1 channel(RGB) in each image, but CPA seems to not display RGB and split channels when I try to view images:

I tried the new scripts:

It is still not working and I got the same error message in the log file:

image


#4

Can you try this mod? Beyond that, I’m not sure- the GitHub issue you linked is still open, so the work is presumably not done yet, and CPA isn’t really designed for RGB images (which are 3 channels, R, G, and B). Sorry!

image_path_cols = Image_PathName_RawData,Image_PathName_RawData,Image_PathName_RawData,Image_PathName_OverlappedWormOutlines
image_file_cols = Image_FileName_RawData,Image_FileName_RawData,Image_FileName_RawData,Image_FileName_OverlappedWormOutlines
image_thumbnail_cols =
image_names = RawData_Red, RawData_Green, RawData_Blue, OverlappedWormOutlines
image_channel_colors = red, green, blue, grey
channels_per_image = 3, 1
image_channel_blend_modes = add, add, add, add

#5

I just tried, and the problem remains.


#6

On the Classifier, I can see there are red, green and blue options, is there a way to just view the merged images of these three colors on classifer?
image


#7

I have tried to use a previous version of CPA (CPAnalyst_2.0_r8634) and I changed to:

image_channel_paths = Image_PathName_RawData,Image_PathName_OverlappedWormOutlines
image_channel_files = Image_FileName_RawData,Image_FileName_OverlappedWormOutlines
image_thumbnail_cols =
image_names = RawData,OverlappedWormOutlines
image_channel_colors =

It seems to work on old version by default.


#8

Problem solved, the CPA2 r11308 version works and here is my mofification in the property file:

image_channel_colors = red, green, blue, red, green, blue
channels_per_image = 3,3
image_channel_blend_modes = add, add, add, subtract, subtract, subtract
image_tile_size = 250

The RGB images will show up after I made the modification:

This is from the scripts described in this paper, however, some modification needs to apply to make it work. https://www.sciencedirect.com/science/article/pii/S1046202314001704
scripts from the paper:
[image_channel_colors = red,green,blue,red,green,blue]
[channels_per_image = 3,3]
[image_channel_blend_modes = subtract, subtract, subtract, add, add, add]
[image_tile_size = 250]