The main idea of the function is the following: (1) start with a ``good'' cue slice and find a threshold using a histogram-search procedure [2]; (2) for other slices around the cue slice, use an adaptive and iteratively relaxed histogram-search procedure to calculate thresholds. See [12] for more.
mode = restrict_rise
low_threshold = 120
cue_slice = 1
slices_per_group = 2
max_intergroup_change = 20
max_thresh_rise = 20
area_of_interest = no
expansion_factor = 100
levels_per_bin = 2
min_peak_sep = 30
min_peak_area = 2.00
hist_valley_dev = 50
abs_min_peak_sep = 16
abs_min_peak_area = 1
smooth_histogram = yes
The cue slice, specified by the parameter ``cue_slice'', should be a slice where the region of interest is large and has high contrast. (Typically, for a DSR LV volume, this is around slice 35.) Thresholds generally are computed for groups of slices, called slice groups. The number of slices per group is set by the parameter ``slices_per_group''. Thus, if the cue slice is 35 and we pick 3 slices per group, then one threshold is calculated for slices 35-37, the second threshold is computed for slices 38-40, etc. (Similarly, thresholds are computed for slices 32-34, 29-31, etc.)
Thresholds can go up or down from one slice group to the next. The parameters ``mode'', ``max_intergroup_change'', and ``max_thresh_rise'' control the amount that a threshold can change.
For ``mode = usual'', the parameter ``max_intergroup_change'' determines how many graylevels a new threshold can go up or down.
For ``mode = restrict rise'', the parameter ``max_intergroup_change'' determines how many graylevels a new threshold can go down, while the parameter ``max_thresh_rise'' determines how many graylevels a threshold can go up. This mode is useful for situations where the region of interest is weakly separated from the background on a few slices.
The majority of the parameters regulate the histogram search procedure. For a particular group of slices, one grayscale histogram is computed. The parameter ``levels_per_bin'' sets the x-axis resolution. (I recommend setting this to > 1 to give a fuller histogram.) The parameter ``smooth_histogram'' gives one the option of smoothing the histogram - I recommend this.
Figure depicts a grayscale histogram and its
associated parameters. To find a threshold, the histogram
search procedure first locates the two highest (in grayscale)
peaks and then finds the middle of the deepest valid
valley between these peaks. The highest peak must
cover a minimum area of the histogram - this keeps
spurious very high peaks (around, say, 250) from
being considered as peaks and throwing off the
histogram search. The parameter ``min_peak_area''
determines this. This restriction only applies to the
highest peak.
The second highest peak must be a minimum # of graylevels from the highest peak. The parameter ``min_peak_sep'' determines this.
Once the peaks are found, the deepest valid valley between these
peaks is found. The deepest valid valley is the longest
contiguous set of histogram bins that fall within the grayscale
values
and
(see Figure
).
equals
the minimum histogram value between the two peaks and
Only the threshold picked for the cue-slice group must
satisfy the conditions set by
![]() |
(1) | ||
![]() |
(2) |
No threshold can drop below the value set by the parameter ``low_threshold''. This is a good safeguard against anomolies.
In general, all of the voxels in a slice group are used in the histogram analysis. If you elect mbc (minimum-bounding cuboid) analysis, per the parameter ``area_of_interest'', then the number of voxels used can be restricted to a region about the region of interest.
This works as follows. For the cue-slice group, calculate a threshold using all of the voxels in the slices. Threshold the slices and find the minimum bounding rectangle that encompasses all of the large connected clumps of voxels (small clumps are deleted by the autothresholder to reduce spurious points). We only care about the x and y dimensions of this rectangle. Expand each side of this rectangle by Y% per the setting of the parameter ``expansion_factor''. The next group of slices will only use the voxels in this x-y area on each slice of the group. The process is then repeated (get threshold, threshold the slices , get minimum bounding rectangle, etc.) for other slice groups. This method helps focus the histogram search procedure on ``important'' areas - i.e., the objects of interest, nominally assumed to be connected structures over a number of slices.