diff --git a/Source/Processors/PSTH/PeriStimulusTimeHistogramNode.cpp b/Source/Processors/PSTH/PeriStimulusTimeHistogramNode.cpp index d65d36c06fda1825ca3da9f2db5c452248082060..669e105460ee684ee6bdfc649fe7c57db4630af9 100644 --- a/Source/Processors/PSTH/PeriStimulusTimeHistogramNode.cpp +++ b/Source/Processors/PSTH/PeriStimulusTimeHistogramNode.cpp @@ -350,21 +350,20 @@ void PeriStimulusTimeHistogramNode::dumpTimestampEventToDisk(int64 softwareTS,in void PeriStimulusTimeHistogramNode::syncInternalDataStructuresWithSpikeSorter() { - ProcessorGraph *g = getProcessorGraph(); - Array<GenericProcessor*> p = g->getListOfProcessors(); - for (int k=0;k<p.size();k++) + Array<Electrode*> electrodes; + + for (int k=0;k<eventChannels.size();k++) { - if (p[k]->getName() == "Spike Sorter") + if ((eventChannels[k]->type == ELECTRODE_CHANNEL) && + ( static_cast<SpikeChannel*>(eventChannels[k]->extraData.get())->dataType == SpikeChannel::Sorted )) { - SpikeSorter *node = (SpikeSorter*)p[k]; - Array<Electrode*> electrodes = node->getElectrodes(); - - // for each electrode, verify that - // 1. We have it in our internal structure - // 2. All channels match - // 3. We have all sorted unit information - trialCircularBuffer->syncInternalDataStructuresWithSpikeSorter(electrodes); + electrodes.add(static_cast<Electrode*>(eventChannels[k]->extraData->dataPtr)); } + // for each electrode, verify that + // 1. We have it in our internal structure + // 2. All channels match + // 3. We have all sorted unit information + trialCircularBuffer->syncInternalDataStructuresWithSpikeSorter(electrodes); } }