Changing the Settings of a Specific Module
The behaviour of each module is controlled by various settings. The defaults for these are defined in the module’s .xml accompanying header. For example, aamod_slicetiming has the following xml:
<?xml version="1.0" encoding="utf-8"?>
<aap>
<tasksettings>
<aamod_slicetiming domain='session' desc='SPM slice timing' modality='MRI'>
<TRs/>
<slicetime/>
<sliceorder></sliceorder>
<refslice>1</refslice>
<inputstreams>
<stream>epi</stream>
<stream>epi_header</stream>
</inputstreams>
<outputstreams>
<stream>epi</stream>
<stream>sliceorder</stream>
</outputstreams>
</aamod_slicetiming>
</tasksettings>
</aap>
In aa version 4, these settings can be customized in one of three ways, described in turn below.
(1) Modifying XML directly
Make a copy of the xml file in the directory containing your user script, perhaps with
>> copyfile(which('aamod_slicetiming.xml'),'.')
So, for example, you could change the line
<sliceorder></sliceorder>
to
<sliceorder>
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
</sliceorder>
The directory containing this script should be in the Matlab path above the aa directories. It will then be picked up in preference to the aa default.
(2) Modifying settings in user script
All of the .xml headers get read in at the “aarecipe” stage of your user script. You may then modify the settings at any point before the aa_doprocessing command. The task settings are stored in aap.tasksettings.[modulename].tasksettings. So, for example:
aap.tasksettings.aamod_slicetiming.sliceorder=32:-1:1;
You may change the SPM default settings in a similar way, by modifying values in aap.spm using lines like the following:
aap.spm.defaults.normalise.write.vox=[3 3 3];
The aap.spm.defaults structure gets copied into the GLOBAL “defaults” variable before running SPM functions.
(3) Modifying settings in the tasklist
It can also be convenient to modify settings in the tasklist. In this way, they can change value half way through an analysis – for example, on one branch of a branched analysis. An example of this is here.