<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>BatchSmallVolumeCorrections</title><revhistory><revision><revnumber>2</revnumber><date>2013-03-07 21:24:04</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>1</revnumber><date>2010-01-05 18:01:57</date><authorinitials>JohanCarlin</authorinitials></revision></revhistory></articleinfo><section><title>Batch processing of small volume corrections</title><para>The standard small volume correction function in SPM5 (spm_VOI) requires input from the GUI for certain parameters (e.g., the shape of the VOI), and hardcodes others (e.g., the number and spacing of maxima in the table). <ulink url="https://lsr-wiki-01.mrc-cbu.cam.ac.uk/imaging/BatchSmallVolumeCorrections/imaging/BatchSmallVolumeCorrections?action=AttachFile&amp;do=get&amp;target=spm_VOI_Custom.m">This function</ulink> is a variant of the default spm_VOI that includes a struct for setting custom parameters. </para><para>The standard spm_VOI is called with table = spm_VOI(SPM, xSPM, hReg). spm_VOI_custom works exactly the same way, but also takes an optional third <ulink url="https://lsr-wiki-01.mrc-cbu.cam.ac.uk/imaging/BatchSmallVolumeCorrections/imaging/CustomParameters#">CustomParameters</ulink> input. <ulink url="https://lsr-wiki-01.mrc-cbu.cam.ac.uk/imaging/BatchSmallVolumeCorrections/imaging/CustomParameters#">CustomParameters</ulink> is a struct that contains any of up to 5 parameters. If the xyzmm, SPACE and D parameters are defined, extracting the results table for a VOI becomes fully automatic with no GUI input required. </para><para>To use this function, bring up some results in SPM (you can <ulink url="https://lsr-wiki-01.mrc-cbu.cam.ac.uk/imaging/BatchSmallVolumeCorrections/imaging/SpmBatchPrintContrasts#">automate this process too</ulink>) to define the necessary SPM, xSPM and hReg inputs. Then, try something like: </para><screen><![CDATA[% Produces the same output as spm_VOI or just using the small volume button in the GUI
T = spm_VOI_custom(SPM,xSPM,hReg);
]]><![CDATA[
% Now let's specify some custom settings
CustomParameters.Num = 8; % maxima per cluster (default 16)
CustomParameters.Dis = 8; % distance among maxima (mm, default 4)
CustomParameters.xyzmm = [10 -10 10]; % custom centre coordinates (mm)
CustomParameters.SPACE = 'S'; % Spherical VOI
CustomParameters.D = 15; % radius (mm) in the case of a spherical VOI
]]><![CDATA[
% This table should look quite different
T2 = spm_VOI_custom(SPM,xSPM,hReg,CustomParameters);]]></screen><para>(<ulink url="https://lsr-wiki-01.mrc-cbu.cam.ac.uk/imaging/BatchSmallVolumeCorrections/imaging/JohanCarlin#">JohanCarlin</ulink>) </para></section></article>