Nisthresh

Performs background removal on a set of neuroimaging scans. For each image in the set, an intensity (or grey level) threshold is computed below which all voxels are considered to be part of the background, and consequently set to 0. The choice of the threshold is automatically performed by analyzing the grey level histogram of the image, as described below in the Algortihm description section.


Invocation

java Nisthresh
This starts up the java interpreter and runs the Nisthresh application. You need to have set up your environment for java in order for this to work.


Nisthresh window

Information to be entered


Algorithm description

All words in italic are internal variables of the algorithm. Words in bold are parameters which can be specified by the user through the options window of the Nisthresh application.

1. Compute the histogram of the image

The histogram is the curve associated with a grey-level image that shows the number of pixels in the image which have a certain grey level. We don't consider pixels with grey level 0 because they are useless in the algorithm. You can choose the number of grey levels you want per histogram bin by specifying the parameter greys. It has to be a positive integer. For example, if you put 3, the first point of the histogram will be the number of pixels which have grey level 1, 2 and 3, the second point will be the number of pixels which have grey levels 4, 5 and 6. The default is 2 for this parameter.

2. Smooth the histogram

The next step consists in smoothing the resulting curve so that the histogram is easier to process. This is controlled by parameter length, which allows the user to specify the half length for the smoothing. This must be a positive integer. For each point of the histogram, we compute the mean in a window of length 2*length+1 centered on the current point. The result is the smoothed histogram (which will be called 'histogram' in what follows). The default for this parameter is 5.

3. Search for the primary peak

The primary peak is simply given by the absolute maximum of the histogram. Its position is named pos_max1.

./Nisthresh_images/histo1.gif

4. Search for the secondary peak

Then we look for the secondary peak. We find it by computing the maximum of a sub-part of the histogram, beginning a "certain amount away" from pos_max1. The starting point pos_start of the search is defined by the equation search = (pos_start - pos_max1) / (max_grey - pos_max1), where search must be a floating point number between 0 and 1. The default value for this parameter is 0.2. We get through this operation the position pos_max2 and value val_max2 of the secondary peak.

./Nisthresh_images/histo2.gif

5. Search for the minimum between the two peaks

This operation is straightforward: pos_min is the position of the minimum value, then denoted as val_min, of the histogram between pos_max1 and pos_max2.

6. Find the limits of the range where we will choose the threshold

We define a cut value val_cut (a horizontal line on the histogram) by the equation cut = (val_cut - val_min) / (val_max2 - val_min), where cut must be a floating point number between 0 and 1. The default value for this parameter is 0.3. We now consider the intersecting points between this horizontal line at value val_cut and the histogram curve. And we define min_range as being the lowest position of these points above pos_max1, and max_range as being the highest position of these points below pos_max2.

7. Choose the threshold

We now choose the position of the threshold pos_thresh between min_range and max_range according to the value of the parameter position, which must be a floating point value between 0 and 1, defined by the equation position = (pos_thresh - min_range) / (max_range - min_range). The default value for this parameter is 0.5 (middle of the range).

./Nisthresh_images/histo3.gif



Last updated Thu Jun 29 17:59:05 EDT 2000