-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproj_cb.m
More file actions
87 lines (69 loc) · 2.48 KB
/
Copy pathproj_cb.m
File metadata and controls
87 lines (69 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
% Main Program
clear; clc;
% Source-detector Distnace
D = 1000000;
% Orientation: Rotation-, and tilt-angle
phi_deg = 60;
theta_deg = 0;
psi_deg = 0;
% Import multi-page TIFF file
vol = import_tiff_stack('_010.tif');
% Select ROI
vol_roi = select_roi(vol);
vol = vol_roi;
% Projection routine
n_fig = 3;
projection_cb(vol, D, phi_deg, theta_deg, psi_deg,n_fig);
title('Projection of the ORIGINAL Volume');
disp('Proj. of ORIGINAL Volume over - Enter to Continue');
pause;
disp('Interpolation in progress');
vol_int = interp_along_slices(vol, 2);
vol = vol_int;
% n_fig = 4;
% disp('Slices of Interpolated Volume - Enter to continue'); pause;
% disp_vol_slices(vol,n_fig);
% maxx = max(max(max(double(vol))));
% nbins = 1:maxx;
% hist_vol = hist(double(vol(:)), nbins);
% n_fig = 5; figure(n_fig); plot(hist_vol); grid;
% disp('Histogram of Interpolated Volume - Enter to continue'); pause;
% Projection routine
n_fig = 6;
projection_cb(vol, D, phi_deg, theta_deg, psi_deg,n_fig);
title('Projection of the Interpolated Volume');
disp('Proj. of INT-Volume - Enter to Continue'); pause;
% Pre-threshold
th_pre = 3400;
vol_pre_th = pre_threshold(vol,th_pre);
% n_fig = 7;
% disp('Display slices of Thresholded Volume');
% disp_vol_slices(vol_pre_th,n_fig);
% disp('Display of slices of Thresholded Volume over - Enter to continue'); pause;
% % Thresholding:
% th_otsu_norm = graythresh(vol_pre_th); % Find Threshold
% th_otsu = th_otsu_norm*max(max(max(vol_pre_th)));
% th = th_pre;
th = th_otsu;
vol_th_bin = binary_vol_threshold(vol_pre_th, th);
disp(['Otsu-thresholding Done: th_otsu = ',num2str(th)]);
vol = vol_th_bin;
% n_fig = 8;
% disp('Display slices of the binary Volume');
% disp_vol_slices(vol,n_fig);
% disp('Display of slices of the binary Volume over - Enter to continue');
% pause;
% Structuring element - sphere
[x,y,z] = ndgrid(-1:1);
se = strel(sqrt(x.^2 + y.^2 + z.^2) <=1);
% Perform morphological open
vol_open = imopen(vol, se);
vol = vol_open;
n_fig = 9;
projection_cb(vol, D, phi_deg, theta_deg, psi_deg,n_fig);
title('Projection of the Binary Volume - 45 deg');
disp('Proj. of Binary Vol. - Enter to Continue'); pause;
n_fig = 100;
D = 1000000;
gap_disp = 0.00005; gap_ang = 1;
disp_movie(vol, D, phi_deg, gap_ang,gap_disp,n_fig);