General Non-Linear Least-Squares Image Fitting

If none of the built-in fitting functions meets your needs, you can build your own using the General Least-Squares tab:

The tab for the general non-linear
                                                   least-squares fitting

As an example, let's imagine you have a series of gradient-echo images collected different flip angles and a long TR for the purposes of performing a flip-angle calibration. We might expect the signal intensity to vary as the sine of the true flip angle. Thus, you want to fit function of the form:

I=M0*sin(k*α)

where I is the measured signal intensity; M0 is the fully-relaxed signal intensity for a 90° pulse; α is the nominal flip angle and k is a spatially-dependent multiplier that converts the nominal flip angle into the actual flip angle. The objective is to map k. The function to be fitted is entered in the Fit function panel:

fitting_function

You can either type in the function, or you can build up the function from the Operators, Functions and Constants menus: clicking on one of the items in the menus inserts an appropriate piece of text to help build up the function. In the function, you can use:

If the function contains any illegal elements, you will be notified when you try to perform the fit.

The Independent Variable Name

By default, the independent variable in the fit function is "x". You can change this so that the fit function is easier to read and more physically meaningful. In our example, we are varying the flip angle, we we have changed the independent variable name to "alpha".

fitting_function

Optionally, you can scale all the values of the independent variable that you enter by a scaling factor. In this example we want to enter the flip angles in degrees, but the sine function requires angles to be specified in radians. To convert degrees to radians, we enter an independent variable scaling factor of 0.0174533, since 1 degree equals 0.0174533 radians.

Built-in Functions

The fitter has the following built-in functions that you can use in your fit function:

Built-in Constants

The fitter has the following built-in constants:

The fit variables

The fit variables are estimated on a pixel-by-pixel basis, and must appear in the fit function. You set the number of fit variables, their names and other parameters in the Fit variables panel. We have done below that for our example, which requires two fit variables:

fitting_variables

First set the number of fit variables (in the above example, 2); this sets up the Variables panel for you to enter the details of each of the fit variables.

Then, for each of the fit variables, enter: