close all; clear all; warn = warning ('off','all'); poolobj = gcp('nocreate'); if isempty(poolobj) parpool; end pctRunOnAll warning('off','all') %% set path fnIJ='/home/aymanns/registration/ij.jar'; % Path to "ij.jar" fnMIJ='/home/aymanns/registration/mij.jar'; % Path to "mij.jar" javaaddpath(fnIJ); javaaddpath(fnMIJ); addpath('code'); addpath('code/external/utils'); addpath(genpath('code/external/InvPbLib')); %% load file names fname = 'files.json'; fid = fopen(fname); raw = fread(fid,inf); str = char(raw'); fclose(fid); files = parse_json(str); %% Parameters param = default_parameters(); param.lambda = 1000; % Regularization parameter param.gamma = 100; % Sets the strength of the feature matching constraint %% Input - Output type=1; % 0 for Mac users, 1 for Linux users fnMatch=files.tdTom_input;%'/home/aymanns/data/1_Horizontal_VNC/tdTom.tif'; % Sequence used for the feature matching similarity term fnIn1=files.GC6s_input; % Sequence used for the brightness constancy term fnIn2=files.tdTom_input; % Sequence warped with the motion field estimated from fnIn1 and fnMatch N=3; % Motion is estimated on frames 1 to N. If N=-1, motion is estimated on % the whole sequence fnOut1=files.GC6s_registered; % Sequence fnIn1 warped fnOut2=files.tdTom_registered; % Sequence fnIn2 warped fnColor=files.color_flow_out; % Color visualization of the motion field fnVector=files.vectors_out; if type==0 fnDeepMatching='code/external/deepmatching_1.2.2_c++_mac'; elseif type==1 fnDeepMatching='code/external/deepmatching_1.2.2_c++_linux'; end addpath(fnDeepMatching); %% Perform motion compensation motion_compensate(fnIn1,fnIn2,fnMatch,fnDeepMatching,fnOut1,fnOut2,fnColor,fnVector,N,param);