LoadImageDirectory

loadimages
loadimagedirectory
saveimages

#1

Hi All,

Congratulations on your new version of CellProfiler. I’m sure that it represents a monumental amount of work!

I’m trying to get started, working with Windows XP 32 bit. I’m trying to make the new LoadImageDirectory work for me to make projections of stack movies. Are there any other uses for this module?

  1. Is there any way to analyze .stk files in the LoadImageDirectory? I can do it with LoadImages. It seems that I have to take apart the stacks first into individual tif files. I can do this using the attached pipeline: ConvertSTK_Tif_PIPE.mat (719 Bytes). Then I have to put each in a separate folder to be analyzed in LoadImageDirectory? Is there any way to do this automatically, not manually by cutting and pasting?

  2. This is the problem I am having with the LoadImageDirectory module. I don’t know whether I’m just missing some point or if there is a bug, but maybe you can help me out.

I changed my Set Preferences to:

Default input folder:
C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\Images to be analyzed

Default output folder:
C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\Output

If my stacks are loaded in the folder called "Images to be analyzed " in the following pathway:

C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\Images to be analyzed
The actual images are divided into subfolders with the common text "Series"
The images themselves also have the common text “Series”

If I run the module I have various problems. Sometimes I can’t even get through the fisrt module. I get the error message:

There was a problem running the analysis module LoadImageDirectory which is number 01.
Image processing was canceled because the module could not load the image “C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\Images to be analyzed\Series011t00\M01.tif” in directory “C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522”. The error message was “Error using ==> fclose
Invalid file identifier. Use fopen to generate a valid file identifier.”

Stack:
CPimread in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CPsubfunctions\CPimread.m (147)
LoadImageDirectory in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\Modules\LoadImageDirectory.m (205)
AnalyzeImagesButton_Callback in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CellProfiler\CellProfiler.m (10890)
gui_mainfcn in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CellProfiler\CellProfiler.m (12633)
CellProfiler in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CellProfiler\CellProfiler.m (57)

  1. Sometimes I get past the error in the LoadImageDirectory module, but then I get hung op on the second module; SaveImage, which I have described in a separate Post under “SaveImages”, the problem being that it can’t find the image I made in the first module because the program is looking for something with a name other than the one I put in the box i.e., =NewName. Often when that happens, the GUI has lost the text box at the top of the SaveImage module after saving.

I get an error message like this:
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: Image processing was canceled in the SaveImages module because in answer to the question “Which images’ original filenames do you want to use as a base” you have entered improper text. You must choose N, text preceded with =, or an image name that was loaded directly from a LoadImages module. Matlab says that the error is: Reference to non-existent field ‘FileName_ProjectedImage’. in the SaveImages module, which is module #03 in the pipeline.

Stack:
SaveImages in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\Modules\SaveImages.m (276)
AnalyzeImagesButton_Callback in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CellProfiler\CellProfiler.m (10890)
gui_mainfcn in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CellProfiler\CellProfiler.m (12633)
CellProfiler in C:\Program Files\CellProfiler\CompiledCellProfiler_XP32_7522\CompiledCellProfiler_7522\CellProfiler_mcr\CellProfiler\CellProfiler.m (57)

  1. So I tried an alternative approach, with a pipeline that uses only the LoadImage module to load one folder at a time. I have the same problem with the SaveImages module. The disadvantage of this approach is that is takes longer to get through the MakeProjection module, saying it has 76 cycles to analyze for a folder with only 24 images. Is that normal?
    Occasionally it works and I find the projected image in my Output folder. Then I have to go through it again for each folder. I have 81 folders for this particular analysis. Is there any way to do that automatically?

If you need files to analyze I have sent over some tif files from a disassembled stack on another of my posts, Stacking Output Images. Your system won’t accept .stk extensions, but if you would like to play around with some .stk files, give me an email address to send it to.

Thanks,

Jan
MaxProjectionStackPIPE_alt.mat (864 Bytes)
MaxProjectionStackPIPE.mat (642 Bytes)


#2

Hi Jan,

  1. LoadImageDirectory reads images the same way LoadImages does- with a subfunction called CPimread, a modified version of matlab’s imread. The only extensions we’ve added, per user requests, etc have been: dib, mat, fig, zvi, raw, flex and c01. So, if LoadImages is reading your .stks, I’m kind of suprised. If you’d like us to try working with some .stk images, other users have had success using YouSendIt to post large image files.

  2. When matlab generates an ‘invalid file identifier’ error, it means it tried to read the file but couldn’t. I actually don’t get this error at all working with the images you posted, using the pipelines you posted, so I’m guessing maybe it has something to do with reading .stks, or maybe the converted .stks?

  3. In SaveImages, the the second setting, ‘Which images’ original filename…" you must enter an image name from LoadImages- so ProjectedImage won’t work here because it’s created by the pipeline. I tried your pipelines that use = for that setting, and they worked fine.

  4. The problem you’re describing here is why I suggested using LoadImageDirectory- then if you have 8 images in each folder, and 10 folders, you just have 10 cycles as opposed to 80, and just press Analyze images once as opposed to 10 separate times.

The most helpful thing for me to diagnose your issue would probably be to try and work with the .stks, or to see a description of how your images are organized. I may be misunderstanding the analysis you’re trying to conduct.

Hope that helps,
Kate


#3

Hi Kate,

I sent you a private message with details about how to login to my ftp page where these image files are stored. Please let me know if you did not get it or if you have problems opening it.

Thanks,
Jan