Skip to content

Commit

Permalink
doRecompute on import
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Liddell committed Nov 30, 2020
1 parent 94c9c13 commit 3903a23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions +jrclust/+import/kilosort.m
Expand Up @@ -289,6 +289,7 @@
'pcFeatureInd', iNeighPC);

hClust = jrclust.sort.TemplateClustering(hCfg, sRes, dRes);
hClust.doRecompute();

res = jrclust.utils.mergeStructs(dRes, sRes);
res.hClust = hClust;
Expand Down
Expand Up @@ -79,7 +79,7 @@

obj = obj@jrclust.interfaces.Clustering(hCfg, sRes, dRes);

if isfield(sRes, 'spikeClusters') && isfield(sRes, 'clusterCenters')
if isfield(sRes, 'clusterCenters')
obj.clusterCenters = sRes.clusterCenters;
end
end
Expand Down
7 changes: 7 additions & 0 deletions +jrclust/+sort/@TemplateClustering/TemplateClustering.m
Expand Up @@ -28,6 +28,13 @@
end

obj = obj@jrclust.interfaces.Clustering(hCfg, sRes, dRes);

if isfield(sRes, 'templatesByCluster')
obj.templatesByCluster = sRes.templatesByCluster;
elseif isfield(sRes, 'spikeClusters') && isfield(sRes, 'spikeTemplates')
obj.templatesByCluster = cellfun(@(sC) unique(obj.spikeTemplates(sC)), ...
obj.spikesByCluster, 'UniformOutput', 0);
end
end
end

Expand Down

0 comments on commit 3903a23

Please sign in to comment.