Skip to content

Commit 7373dde

Browse files
committed
bugs fix: animal groups
1 parent ac9534f commit 7373dde

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

import/original_data/animal_groups.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ID_1,Group_1,ID_2,Group_2,ID_3,Group_3
12
87,1,43,1,50,1
23
88,2,44,2,51,3
34
90,2,49,1,52,2

segmentation/animal_groups.m

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function previous_callback(varargin)
146146
Table = data{1};
147147
fclose(fid);
148148
% take the appropriate id column based on the session
149-
temp_data = Table(2:end,idx+idx-3:idx+idx-2);
149+
temp_data = Table(2:end,idx+idx-3);
150150
% remove empty cells
151151
temp_data = temp_data(~cellfun('isempty',temp_data));
152152
set(h.listbox_1,'value',1);
@@ -173,7 +173,7 @@ function next_callback(varargin)
173173
Table = data{1};
174174
fclose(fid);
175175
% take the appropriate id column based on the session
176-
temp_data = Table(2:end,idx+idx+1:idx+idx+2);
176+
temp_data = Table(2:end,idx+idx+1);
177177
% remove empty cells
178178
temp_data = temp_data(~cellfun('isempty',temp_data));
179179
set(h.listbox_1,'value',1);
@@ -339,10 +339,10 @@ function ok_callback(varargin)
339339
k = 2;
340340
for i = 1:num_cols/2
341341
for j = 1:size(animal_ids{i},2)
342-
if isempty(Table{j,k})
342+
if isempty(Table{j+1,k})
343343
empty_g = 1;
344344
end
345-
user_groups = [user_groups str2num(Table{j,k})];
345+
user_groups = [user_groups str2num(Table{j+1,k})];
346346
end
347347
k = k+2;
348348
end
@@ -370,8 +370,8 @@ function ok_callback(varargin)
370370
k = 2;
371371
for i = 1:num_cols/2
372372
for j = 1:size(animal_ids{i},2)
373-
if isempty(Table{j,k})
374-
Table{j,k} = generated;
373+
if isempty(Table{j+1,k})
374+
Table{j+1,k} = generated;
375375
end
376376
end
377377
k = k+2;
@@ -404,5 +404,4 @@ function cancel_callback(varargin)
404404
close(gcf);
405405
end
406406
end
407-
end
408-
407+
end

0 commit comments

Comments
 (0)