Load images problem with loading .lif database


#1

Hi, I am trying to load a database of images that I took using a Leica confocal microscope on CP 2.2.0 - it only sees the first image in the database and I cannot figure out how to make it see all the images in the dataset and analyse them one by one?


#2

Hi,

Can you give us some examples or the screenshot of what happens in your pipeline?

Thanks


#3

This is where I am stuck - I am trying to use the LoadImages module to load all images from a .lif project file and I cannot get it to load all 60 images I have in there. It loads the first one, but the first one only.


#4

Is there some reason downstream you need to use LoadImages? I wonder if you use the standard input modules and tell Metadata to “Extract metadata from file header” if that might work better?


#5

For some reason the images input module and all others seem to be blocked for me…Now I exported all the lif files to tif, but now I bumped into this error:
Traceback (most recent call last):
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/gui/pipelinecontroller.py”, line 2826, in do_step
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/pipeline.py”, line 2067, in run_module
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/modules/colortogray.py”, line 309, in run
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/modules/colortogray.py”, line 355, in run_split
IndexError: index 3 is out of bounds for axis 2 with size 3
It seems like the cause is trying to read in the fourth channel, and the pipeline just stops there. Is there a quick fix for this instead of going back to the images and exporting them with a different channel order?
Thanks a million!
Kinga


#6

I wrote a new pipeline, where the standard input modules are active, and tried your suggested method, but it still only sees the first image within the project file, not the other 59 that are in there… :frowning:


#7

Can you upload your image here (or to Google Drive/Dropbox etc and post a link)? The .lif and the .tif both would be great.


#8

#9

The reason you’re not able to split your TIF image into 4 channels is that your exported it as an RGB tif, which only has 3 channels- R,G, and B. You’d need to export it in a different way that preserves the channels to extract all 4.

Extracting the metadata in the LIF in CellProfiler worked fine for me though- see first figure below. Make sure you hit first the “Updata metadata” button under “Extract metadata from -> All images”, then the “Update” button at the bottom in the pane displaying what images have been found.

It seems like some of your series only have 3 channels, while most have 4; this is likely going to cause CellProfiler some problems if you’re trying to apply a 4 channel analysis to all of your series. You may want to do something that limits it only to series which have 4 channels explicitly in NamesAndTypes- see second figure below.


Open lif series individually
#10

Hi, it’s working now! The RGB was a silly oversight on my side…the last thing I can’t figure out is how to extract the file name, which is in the format of a number (10 or 14 or 16)_left or right_number(1-10)? Thanks a million :slight_smile:


#11

As far as I know, there’s no way to directly extract these in CellProfiler- it only extract metadata it needs to the analysis. I’m afraid you’ll have to get that information separately.

If you want CP to have access to the information, you can add it as a CSV- I recently described elsewhere in the forum how to do it, though in this case your first Metadata extraction method is “From file header” rather than “From file name”, and you’d be mapping to “Series” rather than to “Well”.

Sorry!


#12

I could get the file order in excel, but to me it doesn’t seem to be doing them in order? What is the logic behind the order of loading the files?


#13

If you open the file in FIJI/ImageJ, it should show you a list of your images as they’re broken down into Series inside your .lif database; outside of the fact that ImageJ names the Series 1,2,3,etc and CP names them 0,1,2,etc, the order of loading AFAIK should be the same.


#14

All clear now, thank you!!!