Home > SuperSegger > frameLink > continueCellLine.m

continueCellLine

PURPOSE ^

continueCellLine : continues a cell line with the same id.

SYNOPSIS ^

function [data_c, data_r] = continueCellLine( data_c, regNumC, data_r,regNumR, time, errorStat)

DESCRIPTION ^

 continueCellLine : continues a cell line with the same id.
 The cell with region number regNumC in data_c gets the same id as the
 cell with region number regNumR in data_r.

 INPUT :
       data_c : data file (err/seg file) in current frame
       regNumC : region number in current frame
       data_r : data file (err/seg file) in reverse frame
       regNumR : region number in reverse frame
       time : current time frame
       errorStat : error flag

 OUTPUT :
       data_c : updated data file (err/seg file
       data_r : updated data file (err/seg file


 Copyright (C) 2016 Wiggins Lab
 Written by Stella Stylianidou, 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.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [data_c, data_r] = continueCellLine( data_c, regNumC, data_r,...
0002     regNumR, time, errorStat)
0003 % continueCellLine : continues a cell line with the same id.
0004 % The cell with region number regNumC in data_c gets the same id as the
0005 % cell with region number regNumR in data_r.
0006 %
0007 % INPUT :
0008 %       data_c : data file (err/seg file) in current frame
0009 %       regNumC : region number in current frame
0010 %       data_r : data file (err/seg file) in reverse frame
0011 %       regNumR : region number in reverse frame
0012 %       time : current time frame
0013 %       errorStat : error flag
0014 %
0015 % OUTPUT :
0016 %       data_c : updated data file (err/seg file
0017 %       data_r : updated data file (err/seg file
0018 %
0019 %
0020 % Copyright (C) 2016 Wiggins Lab
0021 % Written by Stella Stylianidou, Paul Wiggins.
0022 % University of Washington, 2016
0023 % This file is part of SuperSegger.
0024 %
0025 % SuperSegger is free software: you can redistribute it and/or modify
0026 % it under the terms of the GNU General Public License as published by
0027 % the Free Software Foundation, either version 3 of the License, or
0028 % (at your option) any later version.
0029 %
0030 % SuperSegger is distributed in the hope that it will be useful,
0031 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0032 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0033 % GNU General Public License for more details.
0034 
0035 
0036 % set the death/deathF to current time. They are reset when cell is
0037 % visited again.
0038 if ~any (data_c.regs.ID == data_r.regs.ID(regNumR))
0039     data_c.regs.death(regNumC) = time; % Death/divide time
0040     data_c.regs.deathF(regNumC) = 1; % 1 if cell dies in this frame
0041     data_c.regs.birth(regNumC) = data_r.regs.birth(regNumR); % take birth time from previous frame
0042     data_c.regs.birthF(regNumC) = 0; % Division in this frame
0043     data_c.regs.age(regNumC) = data_r.regs.age(regNumR)+1; % cell age. starts at 1.
0044     data_c.regs.divide(regNumC) = 0; % 1 if succesful division in this frame.
0045     data_c.regs.contactHist(regNumC) = data_r.regs.contactHist(regNumR) || data_c.regs.contact(regNumC);
0046     data_c.regs.ehist(regNumC) = data_r.regs.ehist(regNumR) || errorStat; % 1 if cell has unresolved
0047     % error before this time.
0048     data_c.regs.stat0(regNumC) = data_r.regs.stat0(regNumR); % Results from a successful division.
0049     data_c.regs.sisterID(regNumC) = data_r.regs.sisterID(regNumR);   % sister cell ID
0050     data_c.regs.motherID(regNumC) = data_r.regs.motherID(regNumR);   % mother cell ID
0051     data_c.regs.daughterID{regNumC} = [];   % daughter cell ID
0052     data_c.regs.ID(regNumC) = data_r.regs.ID(regNumR); % cell ID number
0053     
0054     % reset death and division on previous frame
0055     data_r.regs.death(regNumR) = time; % reset death/divide time to current
0056     data_r.regs.deathF(regNumR) = 0; % set to 0 division in previous frame
0057     data_r.regs.divide(regNumR) = 0; % set to 0 succesful division in previous frame
0058     
0059     if isfield( data_c.regs, 'lyse' )
0060         if ~data_r.regs.lyse.errorColor1Cum(regNumR)
0061             data_c.regs.lyse.errorColor1Cum(regNumC) = ...
0062                 time*double(logical(data_c.regs.lyse.errorColor1(regNumC)));
0063         else
0064             data_c.regs.lyse.errorColor1Cum(regNumC) = data_r.regs.lyse.errorColor1Cum(regNumR);
0065         end
0066         
0067         if ~data_r.regs.lyse.errorColor2Cum(regNumR)
0068             data_c.regs.lyse.errorColor2Cum(regNumC) = ...
0069                 time*double(logical(data_c.regs.lyse.errorColor2(regNumC)));
0070         else
0071             data_c.regs.lyse.errorColor2Cum(regNumC) = data_r.regs.lyse.errorColor2Cum(regNumR);
0072         end
0073         
0074         if ~data_r.regs.lyse.errorColor1bCum(regNumR)
0075             data_c.regs.lyse.errorColor1bCum(regNumC) = ...
0076                 time*double(logical(data_c.regs.lyse.errorColor1b(regNumC)));
0077         else
0078             data_c.regs.lyse.errorColor1bCum(regNumC) = data_r.regs.lyse.errorColor1bCum(regNumR);
0079         end
0080         
0081         if ~data_r.regs.lyse.errorColor2bCum(regNumR)
0082             data_c.regs.lyse.errorColor2bCum(regNumC) = ...
0083                 time*double(logical(data_c.regs.lyse.errorColor2b(regNumC)));
0084         else
0085             data_c.regs.lyse.errorColor2bCum(regNumC) = data_r.regs.lyse.errorColor2bCum(regNumR);
0086         end
0087         
0088         if ~data_r.regs.lyse.errorShapeCum(regNumR)
0089             data_c.regs.lyse.errorShapeCum(regNumC)  = ...
0090                 time*double(logical(data_c.regs.lyse.errorShape(regNumC)));
0091         else
0092             data_c.regs.lyse.errorShapeCum(regNumC) = data_r.regs.lyse.errorShapeCum(regNumR);
0093         end
0094     end
0095     
0096 else
0097     idThief = find(data_c.regs.ID == data_r.regs.ID(regNumR));
0098     thiefIsCurReg = numel(idThief) == 1 && (idThief==regNumC);
0099     if ~thiefIsCurReg && data_r.regs.ID(regNumR)~=0
0100         disp (['FRAME :', num2str(time),' ID PROBLEM WITH ',num2str(regNumC), ' ', num2str(data_r.regs.ID(regNumR))]);
0101         %keyboard;
0102     end
0103 end
0104 end

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