-
Notifications
You must be signed in to change notification settings - Fork 0
/
flywheelMRSupportLocalHook.m
76 lines (66 loc) · 2.49 KB
/
flywheelMRSupportLocalHook.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
function flywheelMRSupportLocalHook
% flywheelMRSupportLocalHook
%
% For use with the ToolboxToolbox. Copy this into your
% ToolboxToolbox localToolboxHooks directory (by defalut,
% ~/localToolboxHooks) and delete "Template" from the filename
%
% The thing that this does is add subfolders of the project to the path as
% well as define Matlab preferences that specify input and output
% directories.
%
% You will need to edit the project location and i/o directory locations
% to match what is true on your computer.
%% Say hello
fprintf('* Running flywheelMRSupportLocalHook\n');
toolboxName = 'flywheelMRSupport';
%% Clear out stray prefs
if (ispref(toolboxName))
rmpref(toolboxName);
end
%% Set flywheel API key as a preference
flywheelAPIKey='upenn.flywheel.io:djECOkqztLiqmLCW13b4MKDKjN6QoAZI9IcBqAf3YYp5v_8rBjojHf1Sw';
setpref(toolboxName,'flywheelAPIKey',flywheelAPIKey);
%% Specify base paths for materials and data
[~, userID] = system('whoami');
userID = strtrim(userID);
switch userID
case 'dhb'
baseDir = fullfile(filesep,'Volumes','Users1','Dropbox\ \(Aguirre-Brainard\ Lab\)');
% Could put user specific things in, but at the moment generic
% is good enough.
otherwise
baseDir = fullfile('/Users',userID,'Dropbox\ \(Aguirre-Brainard\ Lab\)');
end
%% Set the workbench command path
if ismac
setpref(toolboxName,'wbCommand','/Applications/workbench/bin_macosx64/wb_command');
end
%% Paths to store flywheel data and scratch space
if ismac
% Code to run on Mac plaform
setpref(toolboxName,'flywheelScratchDir','/tmp/flywheel');
setpref(toolboxName,'flywheelRootDir',fullfile('/Users/',userID,'/Documents/flywheel'));
elseif isunix
% Code to run on Linux plaform
setpref(toolboxName,'flywheelScratchDir','/tmp/flywheel');
setpref(toolboxName,'flywheelRootDir',fullfile('/home/',userID,'/Documents/flywheel'));
elseif ispc
% Code to run on Windows platform
warning('No supported for PC')
else
disp('What are you using?')
end
%% Paths to local applications needed to run this file
if ismac
% Code to run on Mac plaform
setpref(toolboxName,'binANTS',fullfile(baseDir,'FLYW_admin/MRI_processing_apps/ANTs/OSX_10.13.2/ANTs/bin/bin'));
elseif isunix
% Code to run on Linux plaform
setpref(toolboxName,'binANTS',fullfile(baseDir,'FLYW_admin/MRI_processing_apps/ANTs/Ubuntu_16.04/ANTs/bin/bin'));
elseif ispc
% Code to run on Windows platform
warning('No binaries for ANTs on PC')
else
disp('Platform not supported')
end