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: patch2EdgeIm.m
    path of file: ./repos/GIBBON/lib
    
    the code of the file until where you have to start completion: function [varargout]=patch2EdgeIm(varargin)

% function [M,G]=patch2EdgeIm(F,V,voxelSize,imOrigin,imSiz,n)
% -----------------------------------------------------------------------
% This function converts the input patch data specified by the faces F and
% the vertices V into an edge image. 
% The image size, origin, voxel size and the number of edge subdevissions
% can be specified. If not specified the image voxel size is set to 1/10th
% the mean edge length, the size is set to fit the object (with an extra

    
function [varargout]=patch2EdgeIm(varargin)

% function [M,G]=patch2EdgeIm(F,V,voxelSize,imOrigin,imSiz,n)
% -----------------------------------------------------------------------
% This function converts the input patch data specified by the faces F and
% the vertices V into an edge image. 
% The image size, origin, voxel size and the number of edge subdevissions
% can be specified. If not specified the image voxel size is set to 1/10th
% the mean edge length, the size is set to fit the object (with an extra
% voxel spacing all around), the origin is choosen in the corner of the
% tightly fit image and the number of subdevisions is chosen as the maximum
% edge length devided by 1/5th of the voxel size. 
% The output consists of an image M where ones denote edge voxels. The
% optional second output G is a structure containing the fields G.voxelSize
% and G.origin which form the geometric information for the image. 
% 
% 
%
% Kevin Mattheus Moerman
% kevinmoerman@hotmail.com
% 28/08/2013
%------------------------------------------------------------------------

if nargin<2 || nargin>6
        error('Wrong number of input arguments!');
end