% Example batch script for Philips MEGA-PRESS data with accompanying water references and structural images
% Remember to check GannetPreInitialise.m has the appropriate settings for your data

data_dir = '/Users/username/Documents/my_project/data';

metab = {'S01_GABA_68_act.sdat'
         'S02_GABA_68_act.sdat'
         'S03_GABA_68_act.sdat'};
metab = fullfile(data_dir, metab); % It is good practice to include the full path of files
         
water = {'S01_GABA_68_ref.sdat'
         'S02_GABA_68_ref.sdat'
         'S03_GABA_68_ref.sdat'};
water = fullfile(data_dir, water);

anat = {'S01_T1_anat.nii'
        'S02_T1_anat.nii'
        'S03_T1_anat.nii'};
anat = fullfile(data_dir, anat);

MRS = GannetLoad(metab, water);
MRS = GannetFit(MRS);
MRS = GannetCoRegister(MRS, anat);
MRS = GannetSegment(MRS);
MRS = GannetQuantify(MRS);
LS0tCnRpdGxlOiAiQmF0Y2ggcHJvY2Vzc2luZyBzY3JpcHQiCmRhdGU6ICJMYXN0IHVwZGF0ZWQ6IGByIGZvcm1hdChTeXMudGltZSgpLCAnJUIgJWQsICVZJylgIgpvdXRwdXQ6IGh0bWxfZG9jdW1lbnQKLS0tCgpgYGB7ciBzZXR1cCwgaW5jbHVkZSA9IEZBTFNFfQprbml0cjo6b3B0c19jaHVuayRzZXQoZWNobyA9IFRSVUUpCmBgYAoKYGBge3IsIGNoaWxkID0gImpzL2JhY2stdG8tdG9wLmpzIn0KYGBgCgpgYGB7Y3NzLCBlY2hvID0gRkFMU0V9CmJvZHkgLm1haW4tY29udGFpbmVyIHsKICBtYXgtd2lkdGg6IDkwMHB4Owp9CmBgYAoKPGJyPgoKYGBge29jdGF2ZSwgZXZhbCA9IEZBTFNFfQolIEV4YW1wbGUgYmF0Y2ggc2NyaXB0IGZvciBQaGlsaXBzIE1FR0EtUFJFU1MgZGF0YSB3aXRoIGFjY29tcGFueWluZyB3YXRlciByZWZlcmVuY2VzIGFuZCBzdHJ1Y3R1cmFsIGltYWdlcwolIFJlbWVtYmVyIHRvIGNoZWNrIEdhbm5ldFByZUluaXRpYWxpc2U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