% Example script for batch-processing multiple subjects' Siemens IMA data% with accompanying water references. Each subject has four scans each to% be joined together and treated as single datasets during data processing.% % Remember to check GannetPreInitialise.m has the appropriate settings for% your data: 'join' must be set to '1'.data_dir ='/Users/username/Documents/my_project/data';% Root data directory% For joining the four files per subject and batching over multiple% subjects, the data must be entered an an M x N cell array, where M is the% number of files per subject and N is the number of subjects. In this% example, we have only two subjects, each with four files that are to be% joined.sub01 = {'sub-01-1/MPRESS1_1.IMA',...'sub-01-2/MPRESS2_1.IMA',...'sub-01-3/MPRESS3_1.IMA',...'sub-01-4/MPRESS4_1.IMA'};sub02 = {'sub-02-1/MPRESS1_1.IMA',...'sub-02-2/MPRESS2_1.IMA',...'sub-02-3/MPRESS3_1.IMA',...'sub-02-4/MPRESS4_1.IMA'};metab_data = [sub01(:), sub02(:)];% Make an M x N cell arraymetab_data =fullfile(data_dir, metab_data);% It is good practice to include the full pathname% Now we do the same for the water reference data. Because of how file% joining is currently coded in Gannet, there needs to be the same number% of water reference files per subject as the metabolite data.sub01_w = {'sub-01-1_w/WATREF1_1.IMA',...'sub-01-2_w/WATREF2_1.IMA',...'sub-01-3_w/WATREF3_1.IMA',...'sub-01-4_w/WATREF4_1.IMA'};sub02_w = {'sub-02-1_w/WATREF1_1.IMA',...'sub-02-2_w/WATREF2_1.IMA',...'sub-02-3_w/WATREF3_1.IMA',...'sub-02-4_w/WATREF4_1.IMA'};water_data = [sub01_w(:), sub02_w(:)];water_data =fullfile(data_dir, water_data);anat = {'sub-01_T1w.nii','sub-02_T1w.nii'};MRS = GannetLoad(metab_data, water_data);MRS = GannetFit(MRS);MRS = GannetCoRegister(MRS, anat);MRS = GannetSegment(MRS);MRS = GannetQuantify(MRS);