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: signtest.m
    path of file: ./repos/CanlabCore/CanlabCore/@fmri_data
    
    the code of the file until where you have to start completion: function [out, statimg] = signtest(dat, varargin)
% Sign test for each voxel of an fmri_data object
% returns voxel-wise statistic images.
%
% :Usage:
% ::
%
%     [out, statimg] = signtest(dat, [p-val threshold], [thresh_type])
%
% :Inputs:
%
%   **dat:**
%        Should be an fmri_data object with .dat field containing voxels x observations matrix
%
% :Optional inputs: in [  ] above are
%   **p-value threshold:**
%        string indicating threshold type (see help statistic_image.threshold for options)
%
% :Outputs:
%   **out:**
%        is a structure of information about the sign test
%
%   **statimg:**
%        is a statistic_image object that can be thresholded and
%        plotted/imaged.  statimg.dat contains signed direction values,
%       .p contains p-values 
%
% ..
% c Tor Wager, 2011
% ..

    
function [out, statimg] = signtest(dat, varargin)
% Sign test for each voxel of an fmri_data object
% returns voxel-wise statistic images.
%
% :Usage:
% ::
%
%     [out, statimg] = signtest(dat, [p-val threshold], [thresh_type])
%
% :Inputs:
%
%   **dat:**
%        Should be an fmri_data object with .dat field containing voxels x observations matrix
%
% :Optional inputs: in [  ] above are
%   **p-value threshold:**
%        string indicating threshold type (see help statistic_image.threshold for options)
%
% :Outputs:
%   **out:**
%        is a structure of information about the sign test
%
%   **statimg:**
%        is a statistic_image object that can be thresholded and
%        plotted/imaged.  statimg.dat contains signed direction values,
%       .p contains p-values 
%
% ..
% c Tor Wager, 2011
% ..
%
% See also: fmri_data.regress
%

inputargs = {.001, 'uncorrected'};
% default options for thresholding

if ~isempty(varargin)
    for i = 1:length(varargin)
        inputargs{i} = varargin{i};
    end