Movie>split>max project>adjust brightness/intensity>rgb merg

cellprofiler

#1

Hallo,

at the moment I am processing hundreds of images by hand using imageJ. I thought about doing a setup in cellProfiler that would save me a lot of time.
The problem is, that I don’t know at all, what modules would be necessary to do the same I now do by hand. Here is what I do:

1 - I get the image stacks in a format called .dv, which I can convert into avi. The sequence of pictures is: all the red images > all the green images > all the blue images of one stack.
2 - I split them, so that I have 3 separate stacks; one for each color
3 - I do a maximum projection of every stack
4 - I adjust the brightness and intensity (this coud be done by rescaleIntensity and Threshhold, maybe?)
5 - I merge all three images into one colour image or do a montage having all the single colours and one merged image

I would be very happy to hear your suggestions.
TThank you kindly in advance,

Daniela Richter


#2

Okay, now that I posted, I found the “average” module for making projections. My pipeline will thus start with “splitOrSpliceMovie” take the new stacks and project them using “average”, then I will add “rescaleIntensity”, maybe “Treshhold” and then either the “greyToColor” or the “Combine” module. WHat do you think?

Problems I encounter so far:
splitOrSpliceMovie - It wants to know how many pictures I want per split. This is different for every movie I process. It would be better if it would ask for the amount of channels I have and whether they are intercalated/interleaved or in a row.
average - this wants to know WHAT to use for averaging. I told the module that the images are produced in the pipeline, but it is not showing the split avi stacks as an option.

Hmmm… I will try further.

Dani


#3

Okay, so far I split my stacks useing imageJ and save them as one tif per channel. They are then loaded separately into CP by using the text optin and individual image. When I try to load as tiff movie, I get an unspecific error message.
I can then run RescaleIntensity and Average, athough I am not sure wheather the LoadImages(individualImages) loads the whole stack or just one single image.
After that I save the files calling them “N”-inter1, “N”-inter2 and “N”-inter3.
I try to merge the three images by using Gray to color, but I have the problem, that the red channel is missing, although I have a great image in the Average.
I than save the Combined image as “N”-inter4.
To make a tiled picture I open all the images I produced so far and tile them. This never worked so far.

Do you have any suggestions concerning the problems I encountered in the description above?


#4

This is the error message I get, when I try to open the file as stk movie:
There was a problem running the analysis module LoadImages which is number 01. Error using ==> LoadImages at 7
Image processing was canceled in the LoadImages module because an error occurred when trying to load the first set of images. Please check the settings. A common problem is that there are non-image files in the directory you are trying to analyze. Matlab says the problem is: Index exceeds matrix dimensions.

Stack:
LoadImages in /Applications/MACI_1.0.5122/CompiledCP/CellProfiler_mcr/Modules/LoadImages.m (704)
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)

Any idea?


#5

Hello Daniela,

To answer this last question first, we don’t get this error in LoadImages with STK, so that’s puzzling. In any case, you might try the “tif,tiff,flex movies” option instead of the “stk movies” option, and check out GroupMovieFrames (even if this is not a movie through time, per se). Ray has apparently been in contact with you directly on this issue, so I’ll leave it there for now.

Have your other questions been fixed or addressed at this point?

David


#6

Hi there,
I tried the “tiff-movie” option in combination with GroupMovieFrames and it is not giving an error message and working through the pipeline. It is only showing one picture in every step, though. Is that normal even for stacks?

I also have a problem using the rescaleIntensity module, as this should be running right after LoadImages, as should GroupMovieFrame. Is there a way to work around that? I kicked the rescale Intensity out, but this is giving me a blank (all black) picture after GrayToColor.

My pipeline is a s follows:
LoadImages (the two stacks for the two channels) < here I want to add RescaleIntensity
GroupMovieFrames (stack1)
GroupMovieFrames (stack2)
CorrectIllumination_Calculate(stack1)
CorrectIllumination_Calculate(stack2)
CorrectIllumination_Apply(stack1)
CorrectIllumination_Apply(stack2)
Average (stack1)
SaveImages(stack1)
Average(stack2)
SaveImages(stack2)
GrayToColor
SaveImages (Merged picture)
LoadImages (all three saved pictures)
Tile
SaveImages

Daniela


#7

LoadImages doesn’t dynamically update its list of images, so you need to split the pipelines to do the tiling in a separate pass (after the averaging has occurred).

Also, GroupMovieFrames treats a stack as separate images, but it will still work across several stacks. So if you have more than one stack in the directory, it will average together results from multiple stacks. If you want to compute the average within a stack, you need to use a different approach:

  • Use GroupMovieFrames to extract all 8 images from one stack (with 8 different names)
  • Use several Combine modules to average them together (probably simplest to do it with 7 Combines: A+B, C+D, E+F, G+H, AB+CD, EF+GH, and ABCD+EFGH).
  • Do the same for the other stack
  • GrayToColor
  • Save

I’ll try to figure out the rescale intensity problem.


#8

Hallo,
I have a 3-frame-stack. I want to load all three images and rescale and combine them.

It is working in so far that 3 images are loaded and combined. One picture is not loaded though (the 3rd) and another one is loaded twice instead (the first).
set the groupMovieFrames (1, 1, origRed, 2, origGreen, 3, origBlue)
Any suggestions?

Dani


#9

[quote=“Skadi”]Hallo,
I have a 3-frame-stack. I want to load all three images and rescale and combine them.

It is working in so far that 3 images are loaded and combined. One picture is not loaded though (the 3rd) and another one is loaded twice instead (the first).
set the groupMovieFrames (1, 1, origRed, 2, origGreen, 3, origBlue)
Any suggestions?
[/quote]

I think you want that to be (3, 1, origRed, 2, origGreen, …)

Ray Jones