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: extractTS.m
    path of file: ./repos/bspm/thirdparty/MRtools_2015-08-21/fcMRI_scripts
    
    the code of the file until where you have to start completion: function [D altOut] = extractTS(fn, seeds, opt)
%%%  Extract a time series from a 4D Nifti file.
%%%

    
function [D altOut] = extractTS(fn, seeds, opt)
%%%  Extract a time series from a 4D Nifti file.
%%%
%%% INPUTS:
%%% fn:     Path to 4D nifti file.
%%% seeds:  Cell Array of Inputs { {'Label1' [mni coords] [seed diameter]} ...}
%%% opt:    If opt = 1, the time series will be extracted.
%%%         If opt = 0, only the matrix indcies of the seed will be
%%%         computed.
%%%
%%% OUTPUTS
%%% D.fn =  A new filename based on the location and size of the seed.
%%% D.vox_loc = location of the seed in 3D matrix coordinates.
%%% D.vec_loc = location of the seed in vector coordinates.
%%% D.ts =  The time series as computed by the first eigen vector method.
%%% D.tsm = The time series as computed by a simple mean of the values in
%%% the seed at each time point.
%%%
%%% Example: 
%%%    extractTS(rsscan{1}, { ...
%%%         {'PCC'  [  0 -53  26] [8]} ...
%%%         {'mPFC' [  0  52 -06] [8]} ...
%%%         {'lLPC' [-48 -62  36] [8]} ...
%%%         {'LRPC' [ 46 -62  32] [8]} ...
%%%         });
%%%
%%% Written by Aaron Schultz (aschultz@martinos.org)
%%%
%%% Last Updated Dec. 11 2012;
%%%
%%% Copyright (C) 2012,  Aaron P. Schultz
%%%
%%% Supported in part by the NIH funded Harvard Aging Brain Study (P01AG036694) and NIH R01-AG027435 
%%%
%%% This program is free software: you can redistribute it and/or modify
%%% it under the terms of the GNU General Public License as published by
%%% the Free Software Foundation, either version 3 of the License, or
%%% any later version.
%%% 
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%%% GNU General Public License for more details.
altOut{1} = {};
altOut{2} = [];
% keyboard;
if nargin == 2
    opt = 1;
end