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: mars_build_roi.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/marsbar-0.44
    
    the code of the file until where you have to start completion: function o = mars_build_roi
% builds ROIs via the SPM GUI
%
% $Id$

o = [];  
[Finter,Fgraph,CmdLine] = spm('FnUIsetup','Build ROI', 0);

% get ROI type
optfields = {'image','voxel', 'sphere', 'box_cw', 'box_lims'};
optlabs =  {'Image', 'Voxel', 'Sphere',...
	    'Box (centre,widths)', 'Box (ranges XYZ)'};

roitype = char(...
    spm_input('Type of ROI', '+1', 'm',{optlabs{:} 'Quit'},...
	      {optfields{:} 'quit'},length(optfields)+1));

% For selecting images, later
img_flt = mars_veropts('get_img_ext');

d = [];
switch roitype
 case 'image'
  imgname = spm_get(1, img_flt, 'Image defining ROI');
  [p f e] = fileparts(imgname);

    
function o = mars_build_roi
% builds ROIs via the SPM GUI
%
% $Id$

o = [];  
[Finter,Fgraph,CmdLine] = spm('FnUIsetup','Build ROI', 0);

% get ROI type
optfields = {'image','voxel', 'sphere', 'box_cw', 'box_lims'};
optlabs =  {'Image', 'Voxel', 'Sphere',...
	    'Box (centre,widths)', 'Box (ranges XYZ)'};

roitype = char(...
    spm_input('Type of ROI', '+1', 'm',{optlabs{:} 'Quit'},...
	      {optfields{:} 'quit'},length(optfields)+1));

% For selecting images, later
img_flt = mars_veropts('get_img_ext');

d = [];
switch roitype
 case 'image'
  imgname = spm_get(1, img_flt, 'Image defining ROI');
  [p f e] = fileparts(imgname);
  binf = spm_input('Maintain as binary image', '+1','b',...
				      ['Yes|No'], [1 0],1);
  func = '';
  if spm_input('Apply function to image', '+1','b',...
				      ['Yes|No'], [1 0],1);
    spm_input('img < 30',1,'d','Example function:');
    func = spm_input('Function to apply to image', '+1', 's', 'img');
  end