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: spm_vb_graphcut.m
    path of file: ./repos/ExploreASL/External/SPMmodified
    
    the code of the file until where you have to start completion: function labels = spm_vb_graphcut(labels,index,I,W,depth,grnd_type,CUTOFF,DIM)
% Recursive bi-partition of a graph using the isoperimetric algorithm
% 
% FORMAT labels = spm_vb_graphcut(labels,index,I,W,depth,grnd_type,CUTOFF,DIM)
%
% labels     each 
    
function parts = bipartition(W,CUTOFF,ground,method) 
%==========================================================================
function parts = bipartition(W,CUTOFF,ground,method) 
% Computes bi-partition of a graph using isoperimetric algorithm.

% FORMAT parts = bipartition(W,CUTOFF,ground,method) 

% parts     1x2 cell containing indices of each partition 
% W         weight matrix 
% CUTOFF    minimal number of voxels in a segment of the partition
% ground    ground node index
% method    used to solve L0*x0=d0. Options are 'direct' or 'cg', which 
%           x0 = L0\d0 or preconditioned conjugate gradients (see Matlab 
%           rountine pcg.m)   

try, method; catch, method = 'direct'; end