-
Notifications
You must be signed in to change notification settings - Fork 1
/
rapid_reg_fish_20180123.m
81 lines (66 loc) · 2.38 KB
/
rapid_reg_fish_20180123.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
77
78
79
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/DDLFM';
addpath([param.ppath '/lotus-registration']);
param.ipath = [param.ppath '/fish/20180123'];
param.opath = param.ipath;;
param.inter = [param.ipath '/interpolate/'];
elseif ~isempty(strfind(param.hostname, 'willis'))
param.ppath = '/home/jkinney/Desktop/DDLFM';
addpath([param.ppath '/lotus-registration']);
param.ipath = [param.ppath '/fish/20180123'];
param.opath = param.ipath;
param.inter = [param.ipath '/interpolate/'];
else
param.ppath = '/home/jkinney';
addpath([param.ppath '/lotus-registration']);
param.ipath = '/om/project/boyden/DualLensLightField/01_23_18_NLS/video1';
param.opath = '/om/scratch/Tue/jkinney/fish/20180123';
param.spath = '/om/user/jkinney/DLFM/fish/20180123';
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 = 1;
param.n = 500;
%next = param.m;
%next = 298;
next = read_next(param.savePath,'Recon3D_solver_1_FrameNumber_','.mat')
param.rapid = true;
param.parallel = false;
param = read_logs(param);
for i=[next:param.n]
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