Skip to content

Commit

Permalink
added handling for ID=0 to cell/trackOptiClist.m. This code should ne…
Browse files Browse the repository at this point in the history
…ver run but this was added on request by users. There is probably some deeper bug that needs to be resolved. Second try.
  • Loading branch information
Paul Wiggins committed Aug 9, 2018
1 parent ead9f97 commit 4c203ae
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cell/trackOptiClist.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
num_im = numel(contents);

if CONST.parallel.show_status
h = waitbar( 0, 'Making Cells.');
h = waitbar( 0, 'Clist is being built.');
cleanup = onCleanup( @()( delete( h ) ) );
else
h = [];
Expand Down Expand Up @@ -189,6 +189,8 @@

% get lineage stuff done here

ind_tmp0 = (ID==0);

if i == 1
prog = ID;
gen0 = 0*ID;
Expand All @@ -201,7 +203,6 @@
gen = nan( size( ID ) );


ind_tmp0 = (ID==0);
ind_tmp1 = and( ind_tmp0,~birthID_flag);
ind_tmp2 = and( ~ind_tmp0,~birthID_flag);

Expand All @@ -211,7 +212,8 @@

% Start this should never run
if sum(ind_tmp0) > 0
disp( 'ID = 0 detected! Possible tracking problems.' );
disp( [header, 'Clist frame: ',num2str(i), ...
': ID = 0 detected! Possible tracking problems.'] );
end

prog(ind_tmp1) = 0;
Expand Down Expand Up @@ -245,13 +247,13 @@
IDmax = max(ID);

gen0_ = nan( [1,IDmax] );
gen0_(ID) = gen0;
gen0_(ID(~ind_tmp0)) = gen0(~ind_tmp0);

gen_ = nan( [1,IDmax] );
gen_(ID) = gen;
gen_(ID(~ind_tmp0)) = gen(~ind_tmp0);

prog_ = nan( [1,IDmax] );
prog_(ID) = prog;
prog_(ID(~ind_tmp0)) = prog(~ind_tmp0);
% done lineage stuff.

length1 = drill(data_c.CellA,'.length(1)');
Expand Down

6 comments on commit 4c203ae

@Fouga
Copy link

@Fouga Fouga commented on 4c203ae Aug 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I had an error because of ID=0. And everything worked until at least one object is present.
But now I have an error at line 209: Undefined function or variable 'prog_'.
I think you need to put prog_ = nan( [1,IDmax] ); before if i==1 (line 194) ?

@pawiggins
Copy link
Collaborator

@pawiggins pawiggins commented on 4c203ae Aug 14, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pawiggins
Copy link
Collaborator

@pawiggins pawiggins commented on 4c203ae Aug 14, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fouga
Copy link

@Fouga Fouga commented on 4c203ae Aug 15, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pawiggins
Copy link
Collaborator

@pawiggins pawiggins commented on 4c203ae Aug 15, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pawiggins
Copy link
Collaborator

@pawiggins pawiggins commented on 4c203ae Aug 15, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.