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: cat_main_gcut.m
    path of file: ./repos/cat12
    
    the code of the file until where you have to start completion: function [Yb,Yl1] = cat_main_gcut(Ysrc,Yb,Ycls,Yl1,YMF,vx_vol,opt)
% This is an exclusive subfunction of cat_main.
% ______________________________________________________________________
%
% gcut+: skull-stripping using graph-cut
% ----------------------------------------------------------------------
% This routine use morphological, region-growing and graph-cut methods. 
% It starts from the WM segment and grow for lower tissue intensities.
% Atlas knowledge is used to for separate handling of the cerebellum.
% Because its high frequency structures in combination with strong
% noise or other artifacts often lead to strong underestimations.
%
% There are 4 major parameters:
%   gcutstr - strengh of skull-stripping with str=0 - more tissue, str=1 less tissue
%   vx_res - resolution limit for skull-stripping (default 1.5)
%   gcutCSF 
% Especialy the second parameter controls many subparameters for  
% different tissue thresholds, region-growing, closing and smoothing
% parameters.
% This routine have a strong relation to the previous estimated main
% partition map l1, and the blood vessel correction. Therefore, it is
% maybe useful to move it...
%
%   [Yb,Yl1] = cat_main_gcut(Ysrc,Yb,Ycls,Yl1,YMF,vx_vol,opt)
% 
%   Yb   .. updated brain mask
%   Yl1  .. updated label map
% 
%   Ysrc .. anatomical image
%   Yb   .. initial brain mask
%   Ycls .. SPM tissue classification
%   Yl1  .. CAT atlas map
%   YMF  .. subcortical/ventricular regions (for filling in surf. recon.)
%   vx_vol .. image resolutino
%   opt  .. further options
% 
% ___________________________________________________________________
    
function
  LAB  = opt.LAB;                                  % cat atlas regions
  voli = @(v) (v ./ (pi * 4./3)).^(1/3);           % volume > radius
  brad = double(voli(sum(Yb(:)>0).*prod(vx_vol))); % distance and volume based brain radius (brad)
  Yp0  = single(Ycls{3})/255/3 + single(Ycls{1})/255*2/3 + single(Ycls{2})/255; 
  Ygm  = single(Ycls{1})/255;
  Ywm  = single(Ycls{2})/255;
  Ycsf = single(Ycls{3})/255;
  Ymg  = single(Ycls{5})/255; clear Ycls; 
  rvol = [sum(round(Yp0(:)*3)==1), sum(round(Yp0(:)*3)==2), sum(round(Yp0(:)*3)==3)]/sum(round(Yp0(:)*3)>0);
  %noise   = cat_stat_nanstd(Ym(cat_vol_morph(cat_vol_morph(Ym>0.95 & Ym<1.05,'lc',1),'e')));
  
  
  %% set different paremeters to modifiy the stength of the skull-stripping 
  %gc.n = max(0.05,min(0.1,noise));
  % intensity parameter
  gc.h = 3.5 - 0.2*opt.gcutstr + 0.2*opt.LASstr; % 3.25; upper tissue intensity (WM vs. blood vessels)     - higher > more "tissue" (blood vessels)
  gc.g = 1.9 + 0.1*opt.gcutstr; % 1.50; lower tissue intensity (WM vs. blood vessels)     - higher > more "tissue" (blood vessels)
  gc.l = 1.1 + 0.8*opt.gcutstr; % 1.50; lower tissue intensity (WM vs. blood vessels)     - higher > more "tissue" (blood vessels)
  gc.o = 0.2 + 0.8*opt.gcutstr; % 0.50; BG tissue intensity (for high contrast CSF=BG=0!) - lower value > more "tissue"
  % distance parameter
  gc.d = brad*(5 - 4*opt.gcutstr)/mean(vx_vol);               % 3.0;    distance  parameter for downcut - higher > more tissue
  gc.c = max(-0.01,(0.01 - 0.03*opt.gcutstr)*mean(vx_vol));             % -0.005; growing   parameter for downcut - higher > more tissue
  gc.f = max(1,min(4,(brad/200 / (0.7-0.4*opt.gcutstr) * rvol(1)/0.10)/mean(vx_vol))); % closing parameter   - higher > more tissue ... 8
  gc.gd = 1 + 2*opt.gcutstr;
  gc.bd = 3 + 2*opt.gcutstr; 
  % smoothing parameter
  gc.s = 0.2  + 0.30*min(0.6,opt.gcutstr);                   % 0.5;    smoothing parameter   - higher > less tissue
  
  
  if opt.verb, fprintf('\n'); end