@@ -3,19 +3,19 @@ function splitNow(app,~)
33 id = app .Data .splitID ;
44 subClus = app .Data .splitSubclus ;
55 subClus(subClus == id ) = []; % don't need to split from itself
6-
6+
77 % My hardcoded new version
88 assigns = app .Data .spikes .info .kmeans .assigns ;
9-
9+
1010 agg = app .Data .spikes .info .tree ;
11-
11+
1212 lowval = floor(app .SplitChaps .SplitSlider .Value );
13-
13+
1414 changes = agg(1 : lowval ,: );
1515 for c = 1 : size(changes ,1 )
1616 assigns(assigns == changes(c ,2 )) = changes(c ,1 );
1717 end
18-
18+
1919 for s = 1 : length(subClus )
2020 if app .Settings .Debugging
2121 disp([9 ' Splitting ' num2str(subClus(s )) ' out of ' num2str(id )])
@@ -24,7 +24,7 @@ function splitNow(app,~)
2424 % waveforms = app.Data.spikes.waveforms(inds,:);
2525 % check all of the previous assigns(inds) are equal to the original
2626 % id.
27-
27+
2828 app .Data .spikes .assigns(inds ) = subClus(s );
2929 % add this ID back to labels:
3030 app.Data.spikes.labels = [app .Data .spikes .labels ; subClus(s ) 1 ];
@@ -34,17 +34,18 @@ function splitNow(app,~)
3434 end
3535 [~ ,ord ] = sort(app .Data .spikes .labels(: ,1 ));
3636 app.Data.spikes.labels = app .Data .spikes .labels(ord ,: ); % reorder the labels
37-
37+
3838 % original function called by the original splitmerge_tool:
3939 % app.Data.spikes = split_cluster(app.Data.spikes,subClus);
4040 % Nope, I have no idea how that function works. Sticking to my version,
4141 % but if stuff breaks, it might be that I haven't finished all the
4242 % necessary updates when splitting...
43-
43+
4444 app.Data.colors = makeColors(app ,length(unique(app .Data .spikes .assigns )));
45-
45+
4646 app.Data.modified = ones(1 ,length(app .Data .modified )); % one flag for each tab
47+ app.Data.modifyList = [app .Data .modifyList app .Data .splitSubclus ];
4748 app.CommitSplit.Enable = ' on' ;
48-
49+
4950 app .refreshScreen();
50- end
51+ end
0 commit comments