You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_run_setlevel.m
    path of file: ./repos/spm/config
    
    the code of the file until where you have to start completion: function out = spm_run_setlevel(job)

    
function out = spm_run_setlevel(job)
% out = spm_run_setlevel(job)
% test to see how likely it is that an SPM statistical image is a random field.
% based on:
%  Set-level threshold-free tests on the intrinsic volumes of SPMs.
%   Barnes GR, Ridgway GR, Flandin G, Woolrich M, Friston K. Neuroimage. 2013
%__________________________________________________________________________

% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging


%-Load SPM.mat file
%--------------------------------------------------------------------------
max_resel_dimension=3;  %% for now
LOWTHRESH=7; %% t value
threshlevels=[-LOWTHRESH:0.2:LOWTHRESH];
PLOTON=0;
ESTZEROLKC=0; %% don't try and estimate the 0th LKC (as this is given by the topology of the mask)

SPM = [];
load(job.spmmat{:});
out.spmmat = job.spmmat;

cindex=job.cindex; %% contrast of interest

% First we need to redo the residual images - these have normally been cleaned up.

Ic=NaN; %% adjust for everything
disp('Writing new residual images');
Vres = spm_write_residuals(SPM,Ic);

%%% Now to make standardized residual images
nSres=size(Vres,2); %% number of subjects/observations
DIM=Vres.dim;
%-Initialise standardised residual images
%--------------------------------------------------------------------------

M=Vres.mat;
VResI(1:nSres) = deal(struct(...
    'fname',   [],...
    'dim',     DIM,...
    'dt',      [spm_type('float64') spm_platform('bigend