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: cat12_postmortem.m
    path of file: ./repos/cat12/batches
    
    the code of the file until where you have to start completion: %-----------------------------------------------------------------------
% Job saved on 05-Aug-2021 10:59:09 by cfg_util (rev $Rev$)
% spm SPM - SPM12 (7771)
% cfg_basicio BasicIO - Unknown
%-----------------
    
function that smooth the data to simulate
%     the partial volume effect (PVE) for denoising the data. Otherwise, 
%     only the sample points are used and noise is preserved. 
mi = mi + 1; miResize = mi; 
matlabbatch{mi}.spm.tools.cat.tools.resize.data(1)     = cfg_dep('Spatially adaptive non-local means (SANLM) denoising filter: SANLM Images', substruct('.','val', '{}',{misanlm}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files'));
matlabbatch{mi}.spm.tools.cat.tools.resize.restype.res = resolution;
matlabbatch{mi}.spm.tools.cat.tools.resize.interp      = -2005;  
matlabbatch{mi}.spm.tools.cat.tools.resize.prefix      = 'auto'; % this will create some resolution specific values
matlabbatch{mi}.spm.tools.cat.tools.resize.outdir      = {''};
% (5) Normalize and limit image intensities.
%     The SPM segmentation seems to have some issues with strong outliers.  
mi = mi + 1; mihlim = mi;
matlabbatch{mi}.spm.tools.cat.tools.spmtype.data(1)    = cfg_dep('Resize images: Resized', substruct('.','val', '{}',{miResize}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','res', '()',{':'}));
matlabbatch{mi}.spm.tools.cat.tools.spmtype.ctype      = 16;
matlabbatch{mi}.spm.tools.cat.tools.spmtype.prefix     = 'hlim_';
matlabbatch{mi}.spm.tools.cat.tools.spmtype.suffix     = '';
matlabbatch{mi}.spm.tools.cat.tools.spmtype.range      = 99.9999;
matlabbatch{mi}.spm.tools.cat.tools.spmtype.intscale   = 1;
matlabbatch{mi}.spm.tools.cat.tools.spmtype.lazy       = 1;



if BC
  % -----------------------------------------------------------------------
  % only bias correction with very high sampling (<= 1 mm) that was not
  % working quite well for this segmentation itself but helps to model 
  % the brain in the following steps.
  % -----------------------------------------------------------------------
  mi = mi + 1; segment0 = mi; 
  matlabbatch{mi}.spm.spatial.preproc.channel.vols(1)    = cfg_dep('Image data type converter: Converted Images', substruct('.','val', '{}',{mihlim}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files', '()',{':'}));
  matlabbatch{mi}.spm.spatial.preproc.channel.biasreg    = 0;
  matlabbatch{mi}.spm.spatial.preproc.channel.biasfwhm   = 30;     % default = 60 (for 1.5 Tesla and precorrected 3.0 Tesla (T1) data in humans)
  matlabbatch{mi}.spm.spatial.preproc.channel.write      = [0 1];  % we also write the bias corrected image
  matlabbatch{mi}.spm.spatial.preproc.tissue(1).tpm      = {[TPM ',1']};
  matlabbatch{mi}.spm.spatial.preproc.tissue(1).ngaus    = ngaus(1);      
  matlabbatch{mi}.spm.spatial.preproc.tissue(1).native   = [1 0];
  matlabbatch{mi}.spm.spatial.preproc.tissue(1).warped   = [0 0];
  matlabbatch{mi}.spm.spatial.preproc.tissue(2).tpm      = {[TPM ',2']};
  matlabbatch{mi}.spm.spatial.preproc.tissue(2).ngaus    = ngaus(2);    
  matlabbatch{mi}.spm.spatial.preproc.tissue(2).native   = [1 0];
  matlabbatch{mi}.spm.spatial.preproc.tissue(2).warped   = [0 0];
  if BGmodel == 2 
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).tpm(1)   = cfg_dep('Image Calculator: ImCalc Computed Image: TPM3of3_BG', substruct('.','val', '{}',{miBG}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files'));
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).ngaus    = ngaus(3);    
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).native   = [1 0];
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).warped   = [0 0];
  else
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).tpm      = {[TPM ',3']};
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).ngaus    = ngaus(3);    
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).native   = [1 0];
    matlabbatch{mi}.spm.spatial.preproc.tissue(3).warped   = [0 0];
    matlabbatch{mi}.spm.spatial.preproc.tissue(4).tpm(1)   = cfg_dep('Image Calculator: ImCalc Computed Image: TPM4of4_BG', substruct('.','val', '{}',{miBG}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files'));
    matlabbatch{mi}.spm.spatial.preproc.tissue(4).ngaus    = ngaus(4);    
    matlabbatch{mi}.spm.spatial.preproc.tissue(4).native   = [0 0];
    matlabbatch{mi}.spm.spatial.preproc.tissue(4).warped   = [0 0];
  end