From d43de09566d9a38650c723daccfafa9a2e8f81eb Mon Sep 17 00:00:00 2001 From: thesamovar Date: Mon, 29 Apr 2013 14:48:56 -0400 Subject: [PATCH] Allow leaving out bad channels from the channel graph, resolving issue #12 --- spikedetekt/floodfill.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spikedetekt/floodfill.py b/spikedetekt/floodfill.py index c1b3d62..4b0aae0 100644 --- a/spikedetekt/floodfill.py +++ b/spikedetekt/floodfill.py @@ -42,6 +42,10 @@ def connected_components(st_arr, ch_graph, s_back): # in the graph defined by ch_graph in the case of edges, and # j_s from i_s-s_back to i_s. for j_s in xrange(i_s-s_back, i_s+1): + # allow us to leave out a channel from the graph to exclude bad + # channels + if i_ch not in mch_graph: + continue for j_ch in mch_graph[i_ch]: # label of the adjacent element adjlabel = label_buffer[j_s, j_ch]