From b18a1c76652df93b1155b56ccc6eb115340c2e31 Mon Sep 17 00:00:00 2001 From: Alan Race Date: Tue, 28 Jul 2020 09:28:21 +0200 Subject: [PATCH] Reorganised starting of software to be a function This will allow generation of App and Standalone installers --- src/SpectralAnalysis.m => SpectralAnalysis.m | 21 +++---------------- docs-src/content/installation/_index.md | 4 +--- files/README | 2 -- runSpectralAnalysis.m | 1 + .../peakfilter}/PeakThresholdFilterMedian.m | 0 src/{ => util}/strsplit.m | 0 6 files changed, 5 insertions(+), 23 deletions(-) rename src/SpectralAnalysis.m => SpectralAnalysis.m (52%) delete mode 100644 files/README rename src/processing/{preprocessing => peakdetection/peakfilter}/PeakThresholdFilterMedian.m (100%) rename src/{ => util}/strsplit.m (100%) diff --git a/src/SpectralAnalysis.m b/SpectralAnalysis.m similarity index 52% rename from src/SpectralAnalysis.m rename to SpectralAnalysis.m index f00b8a2..ed1b19e 100644 --- a/src/SpectralAnalysis.m +++ b/SpectralAnalysis.m @@ -1,5 +1,6 @@ %% SpectralAnalysis % Spectral Imaging analysis software +function spectralAnalysis = SpectralAnalysis() % Get location of current m-file if(isdeployed()) @@ -23,27 +24,11 @@ if ~exist(spectralAnalysisHome, 'file') mkdir(spectralAnalysisHome); - copyfile([path filesep '..' filesep 'files' filesep 'profiles'], [spectralAnalysisHome filesep 'profiles']) + copyfile([path filesep 'files' filesep 'profiles'], [spectralAnalysisHome filesep 'profiles']) end % TODO: Check version on github to see if update available % Launch spectral analysis interface -try - spectralAnalysis = SpectralAnalysisInterface(); -catch err - if((strcmp(err.identifier, 'MATLAB:class:undefinedMethod') || strcmp(err.identifier, 'MATLAB:class:InvalidSuperClass')) ... - && ~isempty(strfind(err.message, 'Figure'))) - disp('ERROR: Missing MOOGL. Download from https://github.com/AlanRace/MOOGL and place in src/gui/MOOGL folder'); - - return; - else - throw(err); - end -end - +spectralAnalysis = SpectralAnalysisInterface(); -% Check that a valid licence exists, otherwise show the -if(~isValidLicence()) - MissingLicenceFigure(); -end \ No newline at end of file diff --git a/docs-src/content/installation/_index.md b/docs-src/content/installation/_index.md index ad0452f..0d79a3a 100644 --- a/docs-src/content/installation/_index.md +++ b/docs-src/content/installation/_index.md @@ -20,12 +20,10 @@ The source code version requires a valid MATLAB licence. #### Installation with Git -1. Clone the repository and initialise the submodules +1. Clone the repository ```bash git clone https://github.com/AlanRace/SpectralAnalysis -cd SpectralAnalysis -git submodule update --init ``` 2. Open MATLAB and navigate to the folder containing the source code diff --git a/files/README b/files/README deleted file mode 100644 index 640ff6a..0000000 --- a/files/README +++ /dev/null @@ -1,2 +0,0 @@ - SpectralAnalysis 0.75 - Alan Race \ No newline at end of file diff --git a/runSpectralAnalysis.m b/runSpectralAnalysis.m index fd6b40b..01837dd 100644 --- a/runSpectralAnalysis.m +++ b/runSpectralAnalysis.m @@ -2,6 +2,7 @@ path = [fileparts(mfilename('fullpath')) filesep 'src']; % Ensure all folders are on the path +addpath(fileparts(mfilename('fullpath'))); addpath(genpath(path)); SpectralAnalysis \ No newline at end of file diff --git a/src/processing/preprocessing/PeakThresholdFilterMedian.m b/src/processing/peakdetection/peakfilter/PeakThresholdFilterMedian.m similarity index 100% rename from src/processing/preprocessing/PeakThresholdFilterMedian.m rename to src/processing/peakdetection/peakfilter/PeakThresholdFilterMedian.m diff --git a/src/strsplit.m b/src/util/strsplit.m similarity index 100% rename from src/strsplit.m rename to src/util/strsplit.m