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: iimg_reconstruct_3dvol.m
    path of file: ./repos/CanlabCore/CanlabCore/Index_image_manip_tools
    
    the code of the file until where you have to start completion: function voldata = iimg_reconstruct_3dvol(dat, volInfo, varargin)
% Reconstruct a 3-D volume from a dat i
    
function [name, n] = make_img_filename(name)
[d, name, ext] = fileparts(name);
name(name == '.') = '_';

% changed nov 07 to preserve commas for multi-volume images.
% handle the comma to index volume: return as n and take it off the
% filename
t = find(ext==',');

n = 1;
if ~isempty(t)
    t = t(1);
    n1 = ext((t+1):end