11function CheckTargets(MRS_struct )
22
33filepath = 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.' ;
55msg = hyperlink([' matlab: opentoline('' ' filepath ' '' , 4, 0)' ], ' Incorrect targets entered in GannetPreInitialise.m' , msg );
66
77switch 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
4856end
0 commit comments