| |
Program Functions
148
6.17 Utilities
During the course of this project, many utility functions were created. They might be of gen-
eral use. For example, they do not depend on the mrFindBorders' data structure and can be
used by other programs.
vAddNoiseToPhIm.m
This function adds noise to a phase image. It can be used to create a noisy atlas image, which
is loaded as a measured phase image to test mrFindBorders. Adding noise to the pixels of the
image directly is not the right way (personal communication with Professor David J. Heeger).
To add noise to the data, time series are determined from the phase values in the image. From
such time series, amplitude images, phase images, and coherence images are usually being
calculated. In this case, they are samples of sine waves. The sine waves are shifted in time
direction by phase offsets, which correspond to phases in the phase image. Once the time
series have been calculated, noise is added. According to [-, 2001 #56], random numbers from
a normal distribution can be calculated as follows:
*
;
µ: mean
: standard deviation
randn: MATLAB function that returns random number, chosen from
a normal distribution with mean zero and standard variation one.
x
randn
m
s
=
+
Equation 26: Random
number from normal dis-
tribution
After the noisy time series have been calculated, the function v_computeCorAnalSeries is
called. This function computes an amplitude image, a phase image, and a coherence image.
vAddNoiseToPhIm only returns the noisy phase and coherence images.
|  |
|
| |
|
|