|
| Sorter (SorterHandle iHandle, std::vector< Save * > &iInputSaveVec, std::vector< Save * > &iOutputSaveVec, std::vector< IndicesStruct > iIndicesOut) |
|
void | calcDist (float &oDist, unsigned int cluster1, unsigned int cluster2) |
|
int | fusionPossible (unsigned int idMaster, unsigned int idSlave, float diffCrit) |
|
void | feedSpikeFeatures (float *iFeatures, uint64_t *iTimestamps, int iNspk) |
|
void | clusteringLoop (unsigned int newClusters) |
|
void | fuseCluster (unsigned int idMaster, unsigned int idSlave) |
|
void | killCluster (unsigned int iClusterIndex) |
|
void | killTheList () |
|
void | getClusterCount (int &oClusterCount) |
|
void | threadFunc () |
|
| ~Sorter () |
|
Modules Except for the Accumulator and the Communicator, all Modules share the same structure. For initialization, each Module needs a parameter handle, an std::vector of Saves for their input, an std::vector of Saves for their output and an std::vector of IndicesStructs to know which output Saves require which output. During initialization a worker thread is spawned that tries to receive input from all input Saves. Once one ChunkPtrStruct from each input Save was obtained, functions are called that perform the respective jobs of the module. For each output Save, based on the respective IndicesStruct, the data obtained from these functions is copied and a ChunkPtrStruct that holds a pointer to that data is pushed in the output Save.Module: Sorter For each new spike, a new cluster is generated holding just 1 spike. For each cluster pair, its euclidean distance (after normalization and weighting) is determined. From the closest to the most distant pair, they are tested for fusion using specific criteria: Distance < thr_min => Fuse (thr_min = fusionCriteriaParams[0]) Distance > thr_max => Don't fuse and don't test more distant pairs (thr_max = fusionCriteriaParams[1]) max(abs(AC-CC)) < thr_accc => Don't fuse (thr_accc = fusionCriteriaParams[2]) As we pick different features, their correlation might be too weak. Thus, to improve the correlation-based criterium, selected features of the greater cluster's representative are first ordered by their value (and features of the smaller cluster's representative are sorted accordingly (so that the order of feature indices is equal for both cluster's representatives). This increases correlation and makes differences appear more clearly. Each time 2 clusters are fused, the sorting loop starts again, thereby only fusing the closest possible pairs Sorting stops when no more clusters can be fused or the number of clusters reached min_clusters