%%spm12.m

%%specify spm12 and other toolbox path
spm12_path = 'C:\spm\spm12';
anatomy_path = 'C:\spm\spm12\toolbox\Anatomy';
%spm-related_path = 'path_to_the_application';

% remove spm path
while true
    try
        spm_rmpath;
        catch break
    end
end

% add spm12 and related path
addpath(spm12_path,anatomy_path);

% run spm12
spm;
