Next: Edge Geom Tool Up: Imcalc Tool Previous: Standard Usage   Contents

# Non-Parametric Image Subtraction

The non-parametric image subtraction algorithm described in TINA Memo no 2002-004 is implemented within the Imcalc tool as the dscat button. The algorithm subtracts two images by constructing a joint histogram, normalising it to produce a probability histogram and then, for each pair of corresponding pixels from the original image pair, performing an integration along the column of the histogram defined by the pixel grey-level value from the top-of-stack image, summing all values smaller than that at the position defined by the pixel pair. This is directly equivalent to constructing a confidence interval to generate the probability that the grey-level pairing of the pixels was not generated by the same distribution as the bulk of the images. The algorithm is therefore ideal for detecting small changes in image pairs, such as enhancement of MS lesions between pre- and post-GdDTPA contrast agent injection.

The major advantage of the technique over simple image subtraction is that the resulting difference image can be interpreted directly as a probability image, with a uniform distribution (i.e. the probabilities are ``honest" in the sense that they reflect frequencies of occurrence). In addition, the difference image is not contaminated with consistent differences between the original image pair e.g. overall illumination differences.

The usage of the algorithm is as follows:

• Start a tinaTool: the one supplied in tina-tools as the example2 toolkit is ideal for this.  Start the Imcalc tool and one of Mono, Stereo, or Sequence. Start four new tvtools, and assign them to the imcalc, imcalc2, graph and mono, stereo or sequence Tvs.

• Input two images through either the mono, stereo, or (usual for medical images) sequence tool.

• Push both images to the stack using the "push" button in the tool you used for input.

• Scale both images to a dynamic range of 0-256, using the "scale" button in the Imcalc tool.  If both images are on the stack, you can do this by pressing "scale", then "flp", then "scale" again, in Imcalc.

• Produce a complex image by pressing "cmp" in the "image type" choice list in the Imcalc tool.

• Produce a scattergram by pressing the "scat" button in the Imcalc tool.

• Blur the scattergram a little by pressing the "gauss" button in the Imcalc tool.

Ideally this should be done with a kernel roughly equal in size to the noise on the data: you can check the noise by pressing the "noise" button in Imcalc: the result will be displayed in the Imcalc parameters dialog box as the "const" field: enter the same number in the "sigma" field, and change "range" to be roughly five times larger then "sigma".  Sigma is, of course, the standard deviation of the Gaussian kernel used, and "range" is the size at which the kernel is truncated. The Imcalc parameters dialog box can be accessed by pressing "Imcalc Params" in the Imcalc tool.

• Produce the subtraction image by pressing the "dscat" button in the Imcalc tool.

This will produce the subtraction image in the imcalc Tv.  The subtraction image should have a flat histogram: you can check this by pressing the "hist" button in the "Imcalc Mice" choice list, and then drawing a box in the imcalc tv using the left mouse button (click and drag). The result will be displayed in the Imcalc graph Tv.

The subtraction image is a probability image, produced by a hypothesis test: pixels which are not drawn from the same distribution as the bulk of the pixels in the image pair will have a low value.  Such pixels can be extracted using the thresh button in Imcalc.  Press the "-1*" button in Imcalc to invert the image, then enter the desired threshold in the "thresh" field of the Imcalc Parameters dialog box (hint: try -0.05 as a starting point, to threshold the image at the 95% confidence limit). Then press "thresh" in the Imcalc tool.  This will set all pixels with lower values (i.e. higher probabilities prior to the inversion) to 0.

Next: Edge Geom Tool Up: Imcalc Tool Previous: Standard Usage   Contents
root 2019-03-24