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: volumewrite_spm.m
    path of file: ./repos/fecgsyn/subfunctions/data-generation/libs/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function [Va] = volumewrite_spm(filename, data, transform, spmversion)

% VOLUMEWRITE_SPM writes anatomical or functional MRI volume data to analyze or nifti format

    
function [Va] = volumewrite_spm(filename, data, transform, spmversion)

% VOLUMEWRITE_SPM writes anatomical or functional MRI volume data to analyze or nifti format
% using the SPM toolbox.
%
% Use as
%   [Va] = volumewrite_spm(filename, data, transform)

% Copyright (C) 2006, Robert Oostenveld
% Copyright (C) 2011, Jan-Mathijs Schoffelen

if nargin<4 || isempty(spmversion)
  spmversion = 'spm8';
end