1: |
Input: Integer values for upper and lower volumetric threshold bounds, maximum number of iterations max_iterations, if desired |
2: |
Output: Volumetric threshold volume_thresh corresponding to the global minimum distribution fitting error |
3: |
min_thresh = lower_bound, max_thresh = upper_bound, current_thresh = min_thresh |
4: |
for
i=l: max_iterations
do
|
5: |
if
i > 1 do
|
6: |
current_thresh = max_thresh
|
7: |
else do
|
8: |
sorting_indices = sort(errors, ‘ascending’) |
9: |
current_thresh = round(men(threshes(sorting_indices (1)), threshes(sorting_indices (2)))) |
10: |
end
|
11: |
past_threshes(i) = current_thresh
|
12: |
if
past_threshes(i) = past_threshes(i−1) do |
13: |
break
|
14: |
end
|
15: |
segment image using current_thresh
|
16: |
generate histogram of volumetric data |
17: |
calculate fitting_error for Gamma distribution |
18: |
past_errors(i) = sum(fltting_error) |
19: |
end
|