Measuring cell migration from spheroid into matrix


I am analyzing the influence of mechanical and biological properties on the migration of tumor cells. In order to investigate this I made matrices with changing collagen concentrations and fibroblast densities. Malignant epithelial cells (4T1) were injected into these matrices, forming a spheroid. The migration of the tumor cells from the spheroid into the matrix was imaged with bright-field DIC. This resulted in the images below.

Now I need to measure the migration distance of the cells, preferably using the diameter of the spheroids. There are a lot of images to measure and I would like to automate the process, although I do not know what the best approach is. Is there anyone who knows how to approach this?

Thank you in advance




Good day,

this is an interesting task.

If you can ensure near to constant conditions* for each exposure, then a solution appears feasible.

*) Obviously, the second image (24h) has an uneven and darker background which is detrimental for acceptable analyses.

Here are the integrals along concentric circles of the normalized autocorrelation function of the 512x512 central excerpts of your images plotted as a function of the circle radius.

You may apply a criterium (e.g. max. slope) to these plots that indicates the spatial extension of the structures in question.

But please, first make sure your images are acquired in a constant and reproducible fashion.



1 Like

Hi @Kmaan,

you could take a look at KNIME, it has an Image Processing Plugin which enables you to analyze large amounts of data.
04_Diameter_Statistics_For_Rising_Bubbles.knwf (2.9 MB)

You can take a look at this Example Workflow, which calculates the diameters of bubbles in images and use it as a starting point.
I can try to make a workflow based on your images, but I’m not sure what exactly is the sphere in the last image, maybe you can draw it in?

Feel free to ask more questions!


Hello @JoProbst,

KNIME looks like an interesting program, especially the ability to process large amounts of data. If you would like to create a workflow for me, that would be wonderful.

I tried to draw the sphere in the image as best as could, I hope that it is sufficient. When you need more data for the workflow, pleas let me know.

Thank you for taking time to look at my problem.

I gave it a try using a manual threshold, if your other images are similar it should work well. Otherwise you’ll need to adjust it a bit or just come back here and ask. Right now the workflow returns the diameter and size in pixel, you can use the “Math Formula” node to convert it to actual units if you know the scale.
Spheroid_Diameter_Calculation.knwf (412.7 KB)


For me it would be much more important to know the extension of the sprouting (“I need to measure the migration distance”) when measured/estimated by hand. Could you please provide these values for the 24h and the 48h images. Furthermore, the question arises whether you are looking for the mean extension/radius or if you need the extension dependent on the (sprouting) direction?

Both informations will help to assess any automatic approach.



1 Like

Hello @anon96376101,

I am looking at the mean extension/radius. The direction of migration is influenced by uncontrollable factors.
On your earlier post I will keep in mind to make sure that the background is constant

I have the hand measured values for you. In the 24 and 48h images the radius was determined 4x from the middelpoint of the spheroid and a average diameter was calculated.
Diameter 24h = 460,53 um
Diameter 48h = 1172,99 um

Thank you for taking a look at it.


I will start with some auto-advertisement regarding the metrics : I published during my PhD an article (Guiet R et al. , 2011 ; in Figure 2) and we used 3 metrics (it was all manually done, I was not (yet) a “bio-image analyst” at that time) :

  • tracing manually the edge of spheroid (day0) then of the collective invasion (at different time point, day 7 in the figure), make the difference of the 2 areas.
  • counting cells that were outside of the spheroid
  • measuring the maximal distance reached by cells

If I should do it now ( and considering that I have to use transmission) I would acquire a small z-stack and make a “Standard Deviation”-projection of the z-stack . It would help a lot to detect the edges of the sprouting.
Do you have access to a motorized z-stage?

Good luck with your quantification.


1 Like

Unfortunately I do not have access to a z-stage.


You can also try Weka (or Ilastik), see below a quick test.

First you draw Classes (here Background in Green and “Not Background”=“sphero+cells” in Red)

Then you train Classifier :

And finally you apply on the other images.

The important things I could observe (or heard or read about) so far for Weka (or Ilastik):

  • imaging quality should be consistent between images (even illumination … )
  • try to equilibrate the quantity of drawn pixels from the 2 categories
  • try to draw at interfaces between the two categories



Thanks Kmaan,

these values are really helpful, although I think that the precision of two decimals must be doubted.

What would help now is the exact relation between pixel spacing and physical distance in µm of your images. My present guess is 1.225 pel/µm.

The problem with the 48h image is that the sprouting is cut off at the upper and lower image boundary.

In principle, my earlier sketched approach leads to reasonable results (the precision may be debatable though). The problem I’m struggling with is related to the background …

We shall see


Well Kmaan,

here is an experimental ImageJ macro that implements the approach mentioned earlier.

setBatchMode( true );
msg = "Radial_Profile.class";
if ( !File.exists( getDirectory( "plugins" ) + msg ) ) {
		exit( "This macro requires the ImageJ-PlugIn \"" + msg + "\" !" );
msg = "Polynomial_Shading_Corrector.class";
if ( !File.exists( getDirectory( "plugins" ) + msg ) ) {
		exit( "This macro requires the ImageJ-PlugIn \"" + msg + "\" !" );
sampleSz = 64;
name = getTitle();
run( "Set Scale...", "distance=245 known=200 unit=µm" );
run( "32-bit" );
run( "Invert" );
run("Polynomial Shading Corrector", "degree_x=1 degree_y=1 regularization=2");
makeRectangle( getWidth-sampleSz, getHeight-sampleSz, sampleSz, sampleSz );
getRawStatistics( N, mn );
run( "Select None" );
run( "Subtract...", "value=" + mn);
run( "Min...", "value=0" );
run( "Canvas Size...", "width=4096 height=4096 position=Center zero" );
run( "FD Math...", "image1=" + name + " operation=Correlate image2=" + name + " result=Result do" );
selectImage( name );
getRawStatistics( N, mn, mi, mx );
run( "Divide...", "value=" + d2s( mx, 9 )  );
makeOval( 0, 0, 4096, 4096 );
run("Radial Profile", "x=2048 y=2048 radius=2048 use");
Plot.getValues( x, y );
for ( i = 0; i < x.length; i++ ) {
	if ( y[i] < 0.006 ) {
		print( "Mean diameter estimate: " + d2s( x[i], 0 ) + "µm" );
setBatchMode( false );

It requires two ImageJ plugins that need to be installed in the plugins folder of ImageJ:

  1. Radial_Profile.class
  2. Polynomial_Shading_Corrector.class

Paste the macro code to an empty macro window (Plugins >> New >> Macro) and run it.

The results (mean diameter estimate) are:
0h: 213µm
24h: 459µm
48h: 853µm

The low 48h value is due to the cropped image size. A solution for this problem is possible but I suggest to acquire large enough images.

Presently, I use the aforementioned scale setting of 1.225 pel/µm.



Thank you @anon96376101,

It is very nice of you that you took the time to do this.

I am aware of the problems with the 48h images. I want to run experiments using a different objective, so that the sprouting is not cut off. I will take all your comments into account.

Kind regards,

Hi @romainGuiet,

Thank you for taking a look at the problem.
I will try Weka on some of the images.