Matlab is often the platform we choose when it comes to prototyping new algorithms or when the structure of the algorithm is too complex to be written in ImageJ macro languageWe are now considering to switch to Python as a Matlab alternative and as it could also be used as a more powerful language to script ImageJ.


Aim and Results

If your images are corrupted by a strong dominant Gaussian noise you can try this simple filter. It is based on thresholding in the DCT domain and is usually vastly superior to typical Gaussian filtering in term of detail preservation / noise reduction trade-off. The filter unfortunately introduces some block like artifacts that can be mitigated by averaging out overlaping shifted windows (as implemented in the Matlab version) and performing maximum intensity projection after the filtering: As such the filter is way more adapted to process 3D stacks that you plan to maximum intensity project than to process single z slice images.


            Original 3D stack time-lapse                                                 filtered 3D stack time-lapse   
 Maximum intensity projection, single time frame           Maximum intensity projection, single time frame
                    Saturated contrast                                                               Saturated contrast

                           Example short movie (spinning disk)                                                 Example short movie (spinning disk)

Download the two files above (main script and function) and copy them in an empty folder. If necessary convert the multi-tiff file to single tiff files and store them all in an empty folder. This code has been tested under Matlab 2008b.

From Matlab console change the current path to the folder where you copied the two Matlab files. Call the filter by  typing

                         DCTfilter(WinSize,Step,mode,Thresh,KnownStdNoise) and substituting the parameters by numerical values:

                        1) WinSize is typically set around 32 for 512x512 images (it must be a power of two).
                        2) Step is typically set around 4 (it must be a power of two smaller than WinSize).
                        3) mode should be set to 1 (results are typically better than with mode 0, the other modes are experimental).
                        4) Thresh is typically set in the range [0.025 0.075] for mode 1, the higher the stronger the filtering.
                        5) KnownStdNoise is not necessary for mode 1.

If you want to experiment with the other modes you can optionally download function_stdEst2D(z,method) that can be found in the LASIP toolbox, then the parameter KnownStdNoise will be estimated automatically (parameter required for mode 3 only).

Cell Tracking

The first step is to obtain a segmentation mask (Fig. 2.2) of the cells from the original movie (Fig. 2.1). This can be performed by this ImageJ macro.

Open the example movie in Fiji and launch the macro (drag and drop + "Run" in macro editor). Follow the instructions (a good choice for "Noise Tolerance" is 8 for this movie). Save the movie "ParticleStack" to an empty folder. This movie can alternatively be downloaded here.

Next copy Cell Tracker to the previous folder and launch Matlab. From Matlab console change the current path to the folder where you copied the Matlab file and type the name of the file in the console (without the ".m" extension). Select the folder where you saved the movie in the first step: A label mask "Tracking-obj.tif" should be automatically saved by Matlab to the previous folder. You can visualize this label stack in Fiji and apply this LUT to the movie (reset intensity with Image/Adjust/Brightness/Contrast to max value in the last frame). The movie should look like Fig. 2.3. and can alternatively be downloaded here.

Retrieve the labels of the cells you are interested to track in the first frame of the movie by moving the mouse cursor over the cells of interest and reading the intensity value in Fiji bar.

To plot the tracks and the area evolution of the cells (labels) you selected launch Track Analyzer (copy the Matlab file to the previous folder and type in the name of the file in the console). In the first step select the folder with the movies, then type in the cell labels separated by a space character in the next dialog box. Two plots such as in figure 2.4 and 2.5 will be generated.

            Fig. 2.1 Original movie                            Fig. 2.2 Segmentation mask                                 Fig. 2.3 Label mask 
                        (first frame)                                                (first frame)                                                 (first frame)


Fig. 2.4 Area evolution in pixel (vertical axis) of 3 user          Fig. 2.5 Track of 3 user selected  cells. The axis 
          selected cells versus time frame (horizontal)                  represents the X and Y position of the cell centroids.