MRI_Dynamic_Zones_Analyzer - MontpellierRessourcesImagerie/imagej_macros_and_scripts GitHub Wiki

Find and segment zones in which the intensity changes over time. Classify the zones into zones with increasing, decreasing, constant, u-shaped and n-shapes intensity profiles. Count the number of times a zone is touched by the signal in a different channel. Calculate the correlation between the intensity in a zone over time and the intensity in the same zone in a different channel.

active_zones.gif TotalIntDynamicZonesLabel=46.png

Getting Started

If you want to align the frames, you must have a registration plugin installed. You can either use MultiStackReg or Linear_Stack_Alignment_with_SIFT_MultiChannel.

See MultiStackReg for installing MultiStackReg and in addition copy the file multi_stack_reg.ijm into the plugins-folder of FIJI.

You can install Linear_Stack_Alignment_with_SIFT_MultiChannel plugin from the PTBIOP update site.

You also need to have morpholibj (IJPB-plugins) installed.

To install the tool save the file analyze_dynamic_zones.ijm into the folder macros/toolsets of your FIJI installation and the file cross_correlation.py into the folder pluginsof your FIJI installation. Restart FIJI.

Select the "analyze_dynamic_zones" toolset from the >> button of the ImageJ launcher.

toolbar.png

  • the first button opens this help-page
  • the r-button runs the registration or alignment of the frames with the multichannel version of either stackreg or SIFT
  • the a-button runs the analysis on the current image
  • the t-button displays a plot of the total intensity over time for a selected region (select the ROI in the image before pressing the button)
  • the p-button displays a plot of the area over time for a selected region (select the ROI in the image before pressing the button)
  • the m-button displays a plot of the mean intensity over time for a selected region (select the ROI in the image before pressing the button)
  • the c-button displays a plot of the cross-correlation by lag between the dynamic selected in one channel and the mean intensity in the zone in the other channel over time.

Usage

Open a 2D-time-lapse image with 2 channels. If the frames need to be aligned, press the r-button. To select between stack-reg and sift for the alignment, right-click the r-button and select the corresponding option. Note that the alignment might create dark zones at the borders of the image. You should either crop the image to eliminate them or set the border size in the next step to a value that excludes them. Right-click the a-button and adapt the parameters to your needs. Press the a-button. Zones of activity (non constant signal over time) will be segmented and the corresponding labels will be overlaid over the image. Each zone will be labeled increasing, decreasing, constant, n or u. To be considered non-constant the activity must surpass a user selected threshold-value which can be either absolute or relative. You can plot the total-intensity, the area and the mean-intensity for a selected zone (click on the label in the image or on the row in the roi-manager) over time using the t, p and m -buttons. You can display the cross-correlation by lag between the signal in the two channels in a selected zone using the c-button.

Options

reg_options.png

Registration method
Choose between stack-reg and sift. Stack-reg will use correlation to match positions while sift will extract stable landmarks for this.

options.png

Focal adhesions channel
The number of the channel containing the focal adhesions.
Tensin channel
The number of the channel containing the tensin signal.
Dynamic
Choose whether to use the total intensity, the area or the mean intensity classify the zones
Dynamic threshold
The activity must be above the threshold to be considered non-constant
Use relative threshold
If selected a relative threshold between 0 and 1 (the max. intensity in the zone is mapped to one) is used instead of the absolute threshold
Relative dynamic threshold
The value of the relative threshold, between O and 1
Radius of background filter
The radius of the filter that will be used to remove the background. It should be large enough to make the objects of interest mostly disappear.
Gradient filter xy-radius
The radius in x and y of the gradient filter. We are interested in the changes in time so the value for xy should be small
Gradient filter z-radius
The radius in z (really t) of the gradient filter.
Border size
The pixels up to the given distance from the border will be set to zero, to remove objects on the border of the image that would hinder the segmentation.
Show constant zones
If selected ROIs will also be created for constant zones, otherwise only for zones with some activity
LUT for zones
The lookup-table used to assign colors to the segmented zones.

Method

A blurred version of the image is subtracted from the input image to remove background. The z- and t-axes are swapped and a 3D morphological gradient filter is applied. The result is binarized using the Otsu-autothreshold (based on the stack histogram) and a connected component labeling is run after Fill holes has been applied and the border pixels have been removed. For each Label the t-profile for the mean intensity, the area and the total intensity are written to a table. The Gamma Variate is fit to each plot after the plot has been smoothed by a mean filter with the radius 2. The values at the first frame, the last frame and a maximum or minimum between the two are compared to classify the zone into the classes:

  • 0 : decreasing
  • 1 : n (first increasing, then decreasing)
  • 2 : constant
  • 3 : u (first decreasing, then increasing)
  • 4 : increasing

To calculate the number of tensin contacts, first the background is subtracted in the tensin channel, using ImageJ's rolling ball command. Then the signal is thresholded using the moments-auto-threshold method. The number the tensin signal is touching the zone is counted by calculating the number of local maxima with a proeminence above 5 in the time-profile.

The cross-correlation by lag for a range of lags is calculated as the Pearson's coefficient of the overlapping part of the signals when one of the signals has been shifted by lag timepoints. See [3] for the cross-correlation calculation. The minimum Pearson's coefficient, which is usually negative and, in that case indicates the highest anticorrelation, its lag in seconds and the maximium Pearson's coefficient, indicating the highest correlation and its lag in seconds are reported in the results table.

Results

contactClassCorrelationtable.png

touchedTable.png

cross-correlation.png

Literature

  1. Legland, D., Arganda-Carreras, I., & Andrey, P. (2016). MorphoLibJ: integrated library and plugins for mathematical morphology with ImageJ. Bioinformatics, btw413. doi:10.1093/bioinformatics/btw413

  2. P. Thévenaz, U.E. Ruttimann, M. Unser, "A Pyramid Approach to Subpixel Registration Based on Intensity," IEEE Transactions on Image Processing, vol. 7, no. 1, pp. 27-41, January 1998. Other relevant on-line publications are available at http://bigwww.epfl.ch/publications/.

  3. Derrick, T.R. and Thomas, J.M. (2004). Chapter 7. Time-Series Analysis: The cross-correlation function. In: Innovative Analyses of Human Movement, (pp. 189-205), Stergiou, N. (ed). Human Kinetics Publishers, Champaign, Illinois, 189-205.

⚠️ **GitHub.com Fallback** ⚠️