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: bramila_interpvol.m
    path of file: ./repos/bspm/thirdparty/bramila
    
    the code of the file until where you have to start completion: function bramila_interpvol(cfg);
%
% BRAMILA_INTERPVOL - Interpolates a volume e.g. from 6mm to 2mm space, useful to visualize our results with 6mm nodes
%   - Usage:
%   fwd = bramila_interpvol(cfg)
%   - Input:
%   cfg is a struct with following parameters
%		cfg.rois = rois definition;
%		cfg.blacklist = list of nodes to exclude
%		cfg.vals = values to plot for each node (column vector of length == length(rois)). 
%			Note: it can contain more than one column, output will be saved as 4-D image
%		cfg.datasize = the standard template output ([91 109 91] in our cases)
%		cfg.box - 0 (put > 0 if you want a smoothing filter)
%		cfg.interptype = linear, cubic, spline or none
%		cfg.filename = a filename.nii where the data will be saved				
%   - Output:

    
function bramila_interpvol(cfg);
%
% BRAMILA_INTERPVOL - Interpolates a volume e.g. from 6mm to 2mm space, useful to visualize our results with 6mm nodes
%   - Usage:
%   fwd = bramila_interpvol(cfg)
%   - Input:
%   cfg is a struct with following parameters
%		cfg.rois = rois definition;
%		cfg.blacklist = list of nodes to exclude
%		cfg.vals = values to plot for each node (column vector of length == length(rois)). 
%			Note: it can contain more than one column, output will be saved as 4-D image
%		cfg.datasize = the standard template output ([91 109 91] in our cases)
%		cfg.box - 0 (put > 0 if you want a smoothing filter)
%		cfg.interptype = linear, cubic, spline or none
%		cfg.filename = a filename.nii where the data will be saved				
%   - Output:
%       No output, only writes to file. Note that the file has originator issues.
%   - Notes:
%		Add support for bramila_savevolume to fix originator issues. Add better user input testing.
%	Last edit: EG 2014-09-10

    rois=cfg.rois;
    blacklist=cfg.blacklist;
    R=length(rois);
    vals=cfg.vals;
    vals(blacklist,:)=0;

    if(R ~= size(vals,1))
        error('mismatch in the length')
    end