-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProcess4D_BFADF.m
45 lines (32 loc) · 1.04 KB
/
Process4D_BFADF.m
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
%% Read Empad Data
%wdir = '/Users/sukhyun/Desktop/data_from_RH/20161122_EM_2016_11_22_TaS2hovden/';
wdir = 'data/';
fname = 'tas2_06_14mx_cl380mm_ap70_30mrad_spot8_mono60_80kV_93K_50x_50y_100z_432step_x128_y128.raw';
e = empad( [wdir, fname], 128 );
vis4D(e.im4D)
%% Get Average CBED;
CBED_ave = e.pacbed;
f_cbed = figure;
imageBC(CBED_ave)
axis equal
colormap inferno
title('Adjust Contrast and Click Apply')
CBED_thresh = im_thr;
[center,radius] = imfindcircles(CBED_thresh,[10 25],'ObjectPolarity','bright','Sensitivity',0.90);
viscircles(center, radius);
pause
if isempty(radius)
title('Click Center of BF Disk then edge')
[xm,ym] = ginput(2);
center = [xm(1), ym(1)];
radius = sqrt( (xm(1)-xm(2))^2 + (ym(1)-ym(2))^2 );
end
%mradperpix = 30/radii;
%% Form Bright Field Image
bf = e.applyDetector(center(2),center(1), 0, radius);
vis4D(bf.im4D)
%% Form ADF Image
adf_min = 20; %in px
adf_max = 50; %in px
adf = e.applyDetector(center(2),center(1), adf_min, adf_max);
vis4D(adf.im4D)