algorithms

## Class MandersColocalization<T extends RealType<T>>

• Type Parameters:
`T` -

```public class MandersColocalization<T extends RealType<T>>
extends Algorithm<T>```

This algorithm calculates Manders et al.'s split colocalization coefficients, M1 and M2. These are independent of signal intensities, but are directly proportional to the amount of fluorescence in the colocalized objects in each colour channel of the image, relative to the total amount of fluorescence in that channel. See "Manders, Verbeek, Aten - Measurement of colocalization of objects in dual-colour confocal images. J. Microscopy, vol. 169 pt 3, March 1993, pp 375-382".

M1 = sum of Channel 1 intensity in pixels over the channel 2 threshold / total Channel 1 intensity. M2 is vice versa. The threshold may be everything > 0 in the other channel, which we call M1 and M2: without thresholds or everything above some thresholds in the opposite channels 1 or 2, called tM1 and tM2: with thresholds The result is a fraction (range 0-1, but often misrepresented as a %. We wont do that here.

TODO: Further, it could/should/will calculate other split colocalization coefficients, such as fraction of pixels (voxels) colocalized, or fraction of intensity colocalized, as described at: WCIF copy pasted here - credits to Tony Collins.

Number of colocalised voxels - Ncoloc This is the number of voxels which have both channel 1 and channel 2 intensities above threshold (i.e., the number of pixels in the yellow area of the scatterplot).

%Image volume colocalised - %Volume This is the percentage of voxels which have both channel 1 and channel 2 intensities above threshold, expressed as a percentage of the total number of pixels in the image (including zero-zero pixels); in other words, the number of pixels in the scatterplot's yellow area / total number of pixels in the scatter plot (the Red + Green + Blue + Yellow areas).

%Voxels Colocalised - %Ch1 Vol; %Ch2 Vol This generates a value for each channel. This is the number of voxels for each channel which have both channel 1 and channel 2 intensities above threshold, expressed as a percentage of the total number of voxels for each channel above their respective thresholds; in other words, for channel 1 (along the x-axis), this equals the (the number of pixels in the Yellow area) / (the number of pixels in the Blue + Yellow areas). For channel 2 this is calculated as follows: (the number of pixels in the Yellow area) / (the number of pixels in the Red + Yellow areas).

%Intensity Colocalised - %Ch1 Int; %Ch2 Int This generates a value for each channel. For channel 1, this value is equal to the sum of the pixel intensities, with intensities above both channel 1 and channel 2 thresholds expressed as a percentage of the sum of all channel 1 intensities; in other words, it is calculated as follows: (the sum of channel 1 pixel intensities in the Yellow area) / (the sum of channel 1 pixels intensities in the Red + Green + Blue + Yellow areas).

%Intensities above threshold colocalised - %Ch1 Int > thresh; %Ch2 Int > thresh This generates a value for each channel. For channel 1, this value is equal to the sum of the pixel intensities with intensities above both channel 1 and channel 2 thresholds expressed as a percentage of the sum of all channel 1 intensities above the threshold for channel 1. In other words, it is calculated as follows: (the sum of channel 1 pixel intensities in the Yellow area) / (sum of channel 1 pixels intensities in the Blue + Yellow area)

The results are often represented as % values, but to make them consistent with Manders' split coefficients, we will also report them as fractions (range 0-1). Perhaps this helps prevent the confusion in comparisons of results caused by one person's %coloc being a totally different measurement than another person's %coloc.

• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
`static class ` `MandersColocalization.MandersResults`
A result container for Manders' calculations.
`protected class ` `MandersColocalization.SplitCoeffAccumulator`
A class similar to the Accumulator class, but more specific to the Manders' split and other split channel coefficient calculations.

• ### Fields inherited from class algorithms.Algorithm

`name`
• ### Constructor Summary

Constructors
Constructor and Description
`MandersColocalization()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`MandersColocalization.MandersResults` ```calculateMandersCorrelation(TwinCursor<T> cursor, T type)```
Calculates Manders' split coefficients, M1 and M2: without thresholds
`MandersColocalization.MandersResults` ```calculateMandersCorrelation(TwinCursor<T> cursor, T thresholdCh1, T thresholdCh2, ThresholdMode tMode)```
Calculates Manders' split coefficients, tM1 and tM2: with thresholds
`void` `execute(DataContainer<T> container)`
Executes the previously initialized `Algorithm`.
`void` `processResults(ResultHandler<T> handler)`
A method to give the algorithm the opportunity to let its results being processed by the passed handler.
• ### Methods inherited from class algorithms.Algorithm

`addWarning, getName, getWarnings`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### MandersColocalization

`public MandersColocalization()`
• ### Method Detail

• #### execute

```public void execute(DataContainer<T> container)
throws MissingPreconditionException```
Description copied from class: `Algorithm`
Executes the previously initialized `Algorithm`.
Specified by:
`execute` in class `Algorithm<T extends RealType<T>>`
Throws:
`MissingPreconditionException`
• #### calculateMandersCorrelation

```public MandersColocalization.MandersResults calculateMandersCorrelation(TwinCursor<T> cursor,
T type)```
Calculates Manders' split coefficients, M1 and M2: without thresholds
Parameters:
`cursor` - A TwinCursor that walks over two images
`type` - A type instance, its value is not relevant
Returns:
Both Manders' split coefficients, M1 and M2.
• #### calculateMandersCorrelation

```public MandersColocalization.MandersResults calculateMandersCorrelation(TwinCursor<T> cursor,
T thresholdCh1,
T thresholdCh2,
ThresholdMode tMode)```
Calculates Manders' split coefficients, tM1 and tM2: with thresholds
Parameters:
`cursor` - A TwinCursor that walks over two images
`type` - A type instance, its value is not relevant
`thresholdCh1` - type T
`thresholdCh2` - type T
`tmode` - A ThresholdMode the threshold mode
Returns:
Both thresholded Manders' split coefficients, tM1 and tM2.
• #### processResults

`public void processResults(ResultHandler<T> handler)`
Description copied from class: `Algorithm`
A method to give the algorithm the opportunity to let its results being processed by the passed handler. By default this methods passes the collected warnings to the handler and sub-classes should make use of this by adding custom behavior and call the super class.
Overrides:
`processResults` in class `Algorithm<T extends RealType<T>>`
Parameters:
`handler` - The ResultHandler to process the results.