-
Notifications
You must be signed in to change notification settings - Fork 1
/
rapid_reg_worm_20170720.m
78 lines (64 loc) · 2.28 KB
/
rapid_reg_worm_20170720.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
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
clear all;
close all;
%% load parameters
param = init_param();
%% setup parameters
[~,hostname] = system('hostname')
param.hostname = strtrim(hostname);
setup_par
if ~isempty(strfind(param.hostname, 'Justins-Mac'))
param.ppath = '/Users/justin/Desktop/DLFM';
addpath([param.ppath '/lotus-registration']);
param.ipath = [param.ppath '/worm/20170720'];
param.opath = param.ipath;
param.inter = [param.ipath '/interpolate/'];
elseif ~isempty(strfind(param.hostname, 'willis'))
param.ppath = '/home/jkinney/Desktop/DLFM';
addpath([param.ppath '/lotus-registration']);
param.ipath = [param.ppath '/worm/20170720'];
param.opath = param.ipath;
param.inter = [param.ipath '/interpolate/'];
else
param.ppath = '/home/jkinney';
addpath([param.ppath '/lotus-registration']);
param.ipath = '/om/user/ehoseini/MyData/DuallensLightField/7_20_17/video_1';
param.opath = '/om/scratch/Tue/jkinney/worm/20170720';
param.spath = '/om/user/jkinney/DLFM/worm/20170720';
param.inter = [param.spath '/interpolate/'];
C = strsplit(param.opath,'/');
mypath = '';
for i=2:length(C)
mypath = [mypath '/' C{i}]
if ~exist(mypath,'dir')
status = mkdir(mypath);
if status == 1
disp(['Created folder: ' mypath]);
else
disp(['Error attempting to create folder:' mypath]);
status
exit;
end
end
end
end
param.inputFilePath1 = [param.ipath '/horizontal/Reconstructed/'];
param.inputFilePath2 = [param.ipath '/vertical/Reconstructed/'];
param.savePath = [param.opath '/registration/'];
param.voxel_x = 0.323; % um
param.voxel_y = 0.323; % um
param.voxel_z = 4.0; % um
param.m = 13;
param.n = 300;
next = param.m;
last = param.n;
param.rapid = true;
param = read_logs(param);
for i=[next:last]
param.rot = param.rotM + (param.rotN-param.rotM) * (i-param.m)/(param.n-param.m);
tmp_trans = param.transM + (param.transN-param.transM) * (i-param.m)/(param.n-param.m);
param.trans = tmp_trans + [ param.clip(1)*param.voxel_y ...
param.clip(3)*param.voxel_x param.clip(5)*param.voxel_z ];
param.inputFileName = {sprintf('Recon3D_solver_1_FrameNumber_%04d.mat',i)};
param
register(param)
end