Skip to content

Commit 674d1fe

Browse files
committed
Further cosmetic changes
1 parent 31fb73e commit 674d1fe

22 files changed

+79
-49
lines changed

CheckTargets.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
function CheckTargets(MRS_struct)
22

33
filepath = fullfile(fileparts(which(mfilename('fullpath'))), 'GannetPreInitialise.m');
4-
msg = 'Incorrect targets entered in GannetPreInitialise.m. Check spelling, allowable options and order of targets.';
4+
msg = 'Incorrect targets entered in GannetPreInitialise.m. Check spelling, allowable options, and order of targets.';
55
msg = hyperlink(['matlab: opentoline(''' filepath ''', 4, 0)'], 'Incorrect targets entered in GannetPreInitialise.m', msg);
66

77
switch num2str(length(MRS_struct.p.target))
88
case '1'
99
if any(strcmp(MRS_struct.p.target, {'GABA', 'Glx', 'GABAGlx', 'GSH', 'Lac', 'EtOH'}))
1010
if MRS_struct.p.phantom && strcmp(MRS_struct.p.target, 'GABAGlx')
11+
fprintf('\n');
1112
error(msg);
1213
end
1314
if MRS_struct.p.HERMES
1415
msg = 'MRS_struct.p.HERMES is set to 1 in GannetPreInitialise.m. Add a second target metabolite or set flag to 0.';
1516
msg = hyperlink(['matlab: opentoline(''' filepath ''', 4, 0)'], 'Add a second target metabolite', msg);
1617
msg = hyperlink(['matlab: opentoline(''' filepath ''', 33, 0)'], 'set flag to 0', msg);
18+
fprintf('\n');
1719
error(msg);
1820
end
1921
else
22+
fprintf('\n');
2023
error(msg);
2124
end
2225
case '2'
@@ -25,24 +28,29 @@ function CheckTargets(MRS_struct)
2528
all(strcmp(MRS_struct.p.target, {'Glx', 'GSH'})) ...
2629
all(strcmp(MRS_struct.p.target, {'Lac', 'GSH'}))])
2730
if MRS_struct.p.phantom && any(strcmp(MRS_struct.p.target, 'GABAGlx'))
31+
fprintf('\n');
2832
error(msg);
2933
end
3034
if ~MRS_struct.p.HERMES
3135
msg = 'Two target metabolites detected. MRS_struct.p.HERMES must be set to 1 in GannetPreInitialise.m.';
3236
msg = hyperlink(['matlab: opentoline(''' filepath ''', 33, 0)'], 'MRS_struct.p.HERMES must be set to 1', msg);
37+
fprintf('\n');
3338
error(msg);
3439
end
3540
else
41+
fprintf('\n');
3642
error(msg);
3743
end
3844
case '3'
3945
if all(strcmp(MRS_struct.p.target, {'EtOH', 'GABA', 'GSH'}))
4046
if ~MRS_struct.p.HERMES
4147
msg = 'Three target metabolites detected. MRS_struct.p.HERMES must be set to 1 in GannetPreInitialise.m.';
4248
msg = hyperlink(['matlab: opentoline(''' filepath ''', 33, 0)'], 'MRS_struct.p.HERMES must be set to 1', msg);
49+
fprintf('\n');
4350
error(msg);
4451
end
4552
else
53+
fprintf('\n');
4654
error(msg);
4755
end
4856
end

CoRegStandAlone/CoReg.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
spm_version = fileparts(which('spm'));
1818
if isempty(spm_version)
1919
msg = 'SPM not found! Please install SPM12 and make sure it is in your search path.';
20-
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg);
20+
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg);
21+
fprintf('\n');
2122
error(msg);
2223
elseif strcmpi(spm_version(end-3:end),'spm8')
2324
msg = ['SPM8 detected. Gannet no longer supports SPM8. ' ...
2425
'Please install SPM12 and make sure it is in your search path.'];
25-
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg);
26+
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg);
27+
fprintf('\n');
2628
error(msg);
2729
end
2830

2931
if MRS_struct.ii ~= length(struc)
30-
error('The number of NIfTI files does not match the number of MRS files processed by CoRegStandAlone.');
32+
fprintf('\n');
33+
error('The number of structural image files does not match the number of MRS files.');
3134
end
3235

3336
numscans = numel(MRS_struct.metabfile);

CoRegStandAlone/CoRegStandAlone.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
% already exists in the output directory
4545

4646
if nargin == 0
47-
error('MATLAB:minrhs','Not enough input arguments.');
47+
fprintf('\n');
48+
error('MATLAB:minrhs', 'Not enough input arguments.');
4849
end
4950

5051
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CoRegStandAlone/Seg.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
spm_version = fileparts(which('spm'));
2727
if isempty(spm_version)
2828
msg = 'SPM not found! Please install SPM12 and make sure it is in your search path.';
29-
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg);
29+
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg);
30+
fprintf('\n');
3031
error(msg);
3132
elseif strcmpi(spm_version(end-3:end),'spm8')
3233
msg = ['SPM8 detected. Gannet no longer supports SPM8. ' ...
3334
'Please install SPM12 and make sure it is in your search path.'];
34-
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg);
35+
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg);
36+
fprintf('\n');
3537
error(msg);
3638
end
3739

DiscernDataType.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
case '.sdat'
2323
MRS_struct.p.vendor = 'Philips';
2424
otherwise
25-
error('Unrecognized file type! Extension should be .7, .dat, .data, .dcm, .gz, .ima, .nii, .raw, .rda, or, .sdat.');
25+
error('Unrecognized file type! Extension must be .7, .dat, .data, .dcm, .gz, .ima, .nii, .raw, .rda, or, .sdat.');
2626
end
2727

2828
end

GERead.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
MRS_struct.p.nrows_water(ii) = refframes;
326326

327327
if totalframes ~= (dataframes + refframes + 1) * nechoes % RTN 2017
328-
error('# of totalframes not same as (dataframes + refframes + 1) * nechoes');
328+
error('Number of totalframes does not equal (dataframes + refframes + 1) * nechoes');
329329
end
330330

331331
ShapeData = reshape(raw_data, [2 MRS_struct.p.npoints(ii) totalframes nreceivers]);

GannetCoRegister.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@
33
% Coregistration of MRS voxel volumes to imaging datasets, based on headers.
44

55
if nargin < 2
6-
error('MATLAB:minrhs','Not enough input arguments.');
6+
fprintf('\n');
7+
error('MATLAB:minrhs', 'Not enough input arguments.');
78
end
89

9-
MRS_struct.version.coreg = '230313';
10+
MRS_struct.version.coreg = '230314';
1011

1112
warning('off'); % temporarily suppress warning messages
1213

1314
% First check if SPM12 is installed and on the search path
1415
spm_version = fileparts(which('spm'));
1516
if isempty(spm_version)
1617
msg = 'SPM not found! Please install SPM12 and make sure it is in your search path.';
17-
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg);
18+
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg);
19+
fprintf('\n');
1820
error(msg);
1921
elseif strcmpi(spm_version(end-3:end), 'spm8')
2022
msg = ['SPM8 detected. Gannet no longer supports SPM8. ' ...
2123
'Please install SPM12 and make sure it is in your search path.'];
22-
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12', 'SPM12', msg);
24+
msg = hyperlink('https://www.fil.ion.ucl.ac.uk/spm/software/spm12/', 'SPM12', msg);
25+
fprintf('\n');
2326
error(msg);
2427
end
2528

@@ -32,6 +35,7 @@
3235
struc = GetFullPath(struc);
3336

3437
if MRS_struct.p.numScans ~= length(struc)
38+
fprintf('\n');
3539
error('The number of structural image files does not match the number of MRS files processed by GannetLoad.');
3640
end
3741

GannetFit.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
% Signal fitting in the frequency domain using nonlinear least-squares optimization
44

55
if nargin == 0
6-
error('MATLAB:minrhs','Not enough input arguments.');
6+
fprintf('\n');
7+
error('MATLAB:minrhs', 'Not enough input arguments.');
78
end
89

9-
MRS_struct.version.fit = '230313';
10+
MRS_struct.version.fit = '230314';
1011

1112
if MRS_struct.p.PRIAM
1213
vox = MRS_struct.p.vox;
@@ -551,7 +552,7 @@
551552

552553
otherwise
553554

554-
error('Fitting %s not recognised',target{jj});
555+
error('Metabolite ''%s'' not recognized.', target{jj});
555556

556557
end
557558

GannetFitPhantom.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
% Updates by MM 2018-2020
44

55
if nargin == 0
6-
error('MATLAB:minrhs','Not enough input arguments.');
6+
fprintf('\n');
7+
error('MATLAB:minrhs', 'Not enough input arguments.');
78
end
89

9-
MRS_struct.version.fit_phantom = '230125';
10+
MRS_struct.version.fit_phantom = '230314';
1011

1112
if MRS_struct.p.PRIAM
1213
vox = MRS_struct.p.vox;
@@ -281,7 +282,7 @@
281282

282283
otherwise
283284

284-
error('Fitting %s not recognised',target{jj});
285+
error('Metabolite ''%s'' not recognized.', target{jj});
285286

286287
end
287288

GannetLoad.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1515

1616
if nargin == 0
17-
error('MATLAB:minrhs','Not enough input arguments.');
17+
fprintf('\n');
18+
error('MATLAB:minrhs', 'Not enough input arguments.');
1819
end
1920

2021
MRS_struct.version.Gannet = '3.3.1';
21-
MRS_struct.version.load = '230313';
22+
MRS_struct.version.load = '230314';
2223
VersionCheck(0, MRS_struct.version.Gannet);
2324
ToolboxCheck;
2425

@@ -465,10 +466,7 @@
465466
AllFramesFTrealign = AllFramesFT;
466467
MRS_struct.out.reject{ii} = zeros(1,size(AllFramesFT,2));
467468
otherwise
468-
filepath = fullfile(fileparts(which(mfilename('fullpath'))), 'GannetPreInitialise.m');
469-
msg = 'FPC parameter in GannetPreInitialise.m not recognized. Check spelling.';
470-
msg = hyperlink(['matlab: opentoline(''' filepath ''', 22, 0)'], 'FPC parameter in GannetPreInitialise.m not recognized', msg);
471-
error(msg);
469+
error('Alignment method in GannetPreInitialise.m not recognized. Check spelling.');
472470
end
473471

474472
MRS_struct.spec.AllFramesFT = AllFramesFT;

0 commit comments

Comments
 (0)