Home > SuperSegger > viz > showSegData.m

showSegData

PURPOSE ^

showSegData : draws the outlines for the regions in the data file.

SYNOPSIS ^

function showSegData( data, im_flag, gui_fig )

DESCRIPTION ^

 showSegData : draws the outlines for the regions in the data file.

 INPUT :
   data : data (region/cell) file
   im_flag : value from 1 to 3 for different plot styles

 Copyright (C) 2016 Wiggins Lab
 Written by Paul Wiggins, Stella Stylianidou.
 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 showSegData( data, im_flag, gui_fig )
0002 % showSegData : draws the outlines for the regions in the data file.
0003 %
0004 % INPUT :
0005 %   data : data (region/cell) file
0006 %   im_flag : value from 1 to 3 for different plot styles
0007 %
0008 % Copyright (C) 2016 Wiggins Lab
0009 % Written by Paul Wiggins, Stella Stylianidou.
0010 % University of Washington, 2016
0011 % This file is part of SuperSegger.
0012 %
0013 % SuperSegger is free software: you can redistribute it and/or modify
0014 % it under the terms of the GNU General Public License as published by
0015 % the Free Software Foundation, either version 3 of the License, or
0016 % (at your option) any later version.
0017 %
0018 % SuperSegger is distributed in the hope that it will be useful,
0019 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0020 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021 % GNU General Public License for more details.
0022 %
0023 % You should have received a copy of the GNU General Public License
0024 % along with SuperSegger.  If not, see <http://www.gnu.org/licenses/>.
0025 
0026 
0027 phase = data.phase;
0028 segs_3n = data.segs.segs_3n;
0029 segs_good = data.segs.segs_good;
0030 segs_bad = data.segs.segs_bad;
0031 mask_bg = data.mask_bg;
0032 
0033 if ~exist('im_flag','var')
0034     im_flag = 1;
0035 end
0036 
0037 backer = ag(phase);
0038 cell_mask = (mask_bg .* ~segs_good .* ~segs_3n);
0039 
0040 if  ~exist('gui_fig','var') || isempty(gui_fig)
0041     figure(1);
0042 else
0043     axes(gui_fig); % new, ie. used in the GUI version
0044 end
0045 
0046 if im_flag == 1 % displays good, 3n and bad segments
0047     phaseBackag = (ag((~data.mask_cell)));
0048     imshow( cat(3, 0.2*(phaseBackag) + 0.3*ag(segs_3n) + ag(segs_good), ...
0049         0.2*(phaseBackag) + 0.3*ag(segs_3n)  , ...
0050         0.2*(phaseBackag) + 0.3*ag(segs_3n) + ag(segs_bad) ), 'InitialMagnification', 'fit');
0051     
0052 elseif im_flag == 2 % displays cell mask
0053     cc = bwconncomp(cell_mask, 4);
0054     labeled = labelmatrix(cc);
0055     RGB_label = label2rgb(labeled,'lines',[.7 .7 .7]);%,'shuffle');
0056     imshow(RGB_label);
0057     
0058 elseif im_flag == 3 % displays phase
0059     imshow( cat(3,backer,backer,backer) );
0060     
0061 end
0062 
0063 end

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