Home > SuperSegger > segmentation > ssoSegFun.m

ssoSegFun

PURPOSE ^

ssoSegFun : starts segmentation of phase image and sets error flags

SYNOPSIS ^

function [data, err_flag] = ssoSegFun( phase, CONST, header, dataname, crop_box)

DESCRIPTION ^

 ssoSegFun : starts segmentation of phase image and sets error flags
 It creates the first set of good, bad and permanent segments and if
 CONST.seg.OPTI_FLAG is set to true it optimizes the region sizes.
 
 INPUT :
       phase_ : phase image
       CONST : segmentation constants
       header : string displayed with infromation
       dataname : 
       crop_box : information about alignement of the image
 
  OUTPUT :
       data : contains information about the segments and mask, for more
       information look at superSeggerOpti.
       err_flag : set to true if there are more segments than max
            

 Copyright (C) 2016 Wiggins Lab 
 Written by Stella Styliandou & Paul Wiggins.
 University of Washington, 2016
 This file is part of SuperSegger.
 
 SuperSegger is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 SuperSegger is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [data, err_flag] = ssoSegFun( phase, CONST, header, dataname, crop_box)
0002 % ssoSegFun : starts segmentation of phase image and sets error flags
0003 % It creates the first set of good, bad and permanent segments and if
0004 % CONST.seg.OPTI_FLAG is set to true it optimizes the region sizes.
0005 %
0006 % INPUT :
0007 %       phase_ : phase image
0008 %       CONST : segmentation constants
0009 %       header : string displayed with infromation
0010 %       dataname :
0011 %       crop_box : information about alignement of the image
0012 %
0013 %  OUTPUT :
0014 %       data : contains information about the segments and mask, for more
0015 %       information look at superSeggerOpti.
0016 %       err_flag : set to true if there are more segments than max
0017 %
0018 %
0019 % Copyright (C) 2016 Wiggins Lab
0020 % Written by Stella Styliandou & Paul Wiggins.
0021 % University of Washington, 2016
0022 % This file is part of SuperSegger.
0023 %
0024 % SuperSegger is free software: you can redistribute it and/or modify
0025 % it under the terms of the GNU General Public License as published by
0026 % the Free Software Foundation, either version 3 of the License, or
0027 % (at your option) any later version.
0028 %
0029 % SuperSegger is distributed in the hope that it will be useful,
0030 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0031 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0032 % GNU General Public License for more details.
0033 %
0034 % You should have received a copy of the GNU General Public License
0035 % along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.
0036 
0037 if ~exist('header','var')
0038     header = '';
0039 end
0040 
0041 if ~exist('dataname','var')
0042     dataname = '';
0043 end
0044 
0045 if ~exist('crop_box','var')
0046     crop_box = '';
0047 end
0048 
0049 
0050 % create the masks and segments
0051 data = superSeggerOpti( phase ,[], 1 ,CONST, 1, header, crop_box);
0052 
0053 
0054 if numel(data.segs.score) > CONST.superSeggerOpti.MAX_SEG_NUM;
0055     err_flag = true;
0056     save([dataname,'_too_many_segs'],'-STRUCT','data');
0057     disp( [header,'BSSO ',dataname,'_too_many_segs'] );
0058     return
0059 else
0060     err_flag = false;    
0061 end
0062 
0063 % optimize the regions
0064 if CONST.seg.OPTI_FLAG
0065     data = regionOpti( data, 1, CONST,header);
0066     drawnow;
0067 else
0068     data = intMakeRegs( data, CONST );
0069 end
0070 
0071 end
0072

Generated on Thu 19-Jan-2017 13:55:21 by m2html © 2005