-
Notifications
You must be signed in to change notification settings - Fork 1
/
pft_RunThreeDimensionalRigidMergingScript.m
87 lines (63 loc) · 2.48 KB
/
pft_RunThreeDimensionalRigidMergingScript.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
80
81
82
83
84
85
86
87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Clear the workspace
clear all
close all
clc
fclose('all');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Nominate some input folders
if ispc
Username = getenv('Username');
Home = fullfile('C:', 'Users', Username, 'Desktop');
elseif isunix || ismac
[ Status, CmdOut ] = system('whoami');
Home = fullfile('home', CmdOut, 'Desktop');
end
StartPath = uigetdir(Home, 'Select a top-level folder with scan folders inside');
% 01. Low-Venc Magnitude
LoVencMagnitudeSource = uigetdir(StartPath, 'Low-Venc MAGNITUDE folder');
if ~ischar(LoVencMagnitudeSource)
h = msgbox('No folder chosen', 'Exit', 'modal');
uiwait(h);
delete(h);
return;
end
% 02. High-Venc Magnitude
HiVencMagnitudeSource = uigetdir(StartPath, 'High-Venc MAGNITUDE folder');
if ~ischar(HiVencMagnitudeSource)
h = msgbox('No folder chosen', 'Exit', 'modal');
uiwait(h);
delete(h);
return;
end
% 03. Low-Venc Phase
LoVencPhaseSource = uigetdir(StartPath, 'Low-Venc PHASE folder');
if ~ischar(LoVencPhaseSource)
h = msgbox('No folder chosen', 'Exit', 'modal');
uiwait(h);
delete(h);
return;
end
% 04. High-Venc Phase
HiVencPhaseSource = uigetdir(StartPath, 'High-Venc PHASE folder');
if ~ischar(HiVencPhaseSource)
h = msgbox('No folder chosen', 'Exit', 'modal');
uiwait(h);
delete(h);
return;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Nominate a single output root folder
% 01. Sub-folders will be created in the worker function
MergedRoot = uigetdir(StartPath, 'Root folder for OUTPUT files');
if ~ischar(MergedRoot)
h = msgbox('No folder chosen', 'Exit', 'modal');
uiwait(h);
delete(h);
return;
end
%% Fetch the interpolation type
Interpolation = pft_GetInterpolationType;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Call the worker function - this has been written so that it can be called programmatically for multiple acquisitions
pft_RigidThreeDimensionalMergingFunction(LoVencMagnitudeSource, HiVencMagnitudeSource, LoVencPhaseSource, HiVencPhaseSource, MergedRoot, Interpolation);