-
Notifications
You must be signed in to change notification settings - Fork 59
/
PTKUtils.m
78 lines (61 loc) · 2.35 KB
/
PTKUtils.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
classdef (Sealed) PTKUtils < handle
% PTKUtils. A script to update the PTK codebase via git
%
%
%
% Licence
% -------
% Part of the TD Pulmonary Toolkit. https://github.com/tomdoel/pulmonarytoolkit
% Author: Tom Doel, 2015. www.tomdoel.com
% Distributed under the GNU GPL v3 licence. Please see website for details.
%
methods (Static)
function RunScript(script_name, varargin)
% Runs a PTKScript from the Scripts folder
m = PTKMain();
m.RunScript(script_name, varargin{:});
end
function Recompile()
% Forces recompilation of mex files
m = PTKMain();
m.Recompile();
end
function RebuildDatabase()
% Forces a rebuild of the image database
m = PTKMain();
m.RebuildDatabase();
end
function ClearMemory()
% Clears out memory caches
close all;
clear all classes;
path(pathdef);
end
function ClearDisk()
% Clears out disk and memory caches for temporary files
m = PTKMain();
m.DeleteCacheForAllDatasets();
end
function ReloadPlugins()
% Forces reload of plugin information. Useful if you have modified properties of the plugin
m = PTKMain();
m.ReloadPlugins();
end
function Clear()
PTKUtils.ClearMemory();
PTKAddPaths();
end
end
methods (Access = private)
function obj = PTKUtils()
disp('PTKUtils contains method to help maintain your PTK');
disp('PTKUtils.RunScript(script_name, parameters) will run a PTKScript with the specified parameters');
disp('PTKUtils.RebuildDatabase() will reimport your imaging files and correct problems with the database');
disp('PTKUtils.ReloadPlugins() will reload plugins to fetch property changes');
disp('PTKUtils.Recompile() will recompile your mex files');
disp('PTKUtils.ClearMemory() will clear all the memory caches');
disp('PTKUtils.ClearDisk() will clear the disk caches to retrieve disk space');
ClearDisk
end
end
end